You've deployed an ASP.NET Core application, but users report they're not able to access CSS and images. Which middleware might you have forgotten to configure in Startup.cs?

  • UseStaticFiles
  • UseAuthentication
  • UseAuthorization
  • UseRouting
The UseStaticFiles middleware is responsible for serving static files, such as CSS and images, to clients. If users can't access these files, you might have forgotten to configure this middleware in the Startup.cs file. Ensure you've included app.UseStaticFiles(); in your Configure method to serve these files properly.

ASP.NET Core Web APIs use the ________ format as a standard for transmitting data.

  • JSON
  • XML
  • Binary
  • CSV
ASP.NET Core Web APIs primarily use the JSON (JavaScript Object Notation) format for transmitting data. JSON is lightweight, human-readable, and widely supported, making it a popular choice for APIs.

How can you configure session timeout for a logged-in user in ASP.NET Core?

  • Set the "SessionTimeout" attribute in the Startup.cs file
  • Use the "app.UseSession" method and configure "SessionTimeout" in services.Configure
  • Use the "app.UseSession" method and configure "IdleTimeout" in services.Configure
  • Set the "SessionTimeout" attribute in the appsettings.json file
To configure session timeout in ASP.NET Core, you should use the "app.UseSession" method in the "Configure" method of the Startup.cs file. The session timeout can be set using the "IdleTimeout" property in the services.Configure method. This middleware enables session state in the application, and configuring the timeout here is the correct approach.

What is the primary purpose of using attribute routing in ASP.NET Core?

  • Centralized route configuration
  • Database management
  • Authentication handling
  • HTML rendering
Attribute routing in ASP.NET Core allows for centralized route configuration, making it easier to define routes for specific actions or controllers directly within the code using attributes. This provides a more intuitive way to specify routes and helps keep routing logic within the controllers where it belongs.

What is the primary distinction between Visual Studio and Visual Studio Code?

  • Visual Studio is a full-featured integrated development environment (IDE), while Visual Studio Code is a lightweight code editor.
  • Visual Studio Code is only available for macOS, while Visual Studio is available for Windows only.
  • Visual Studio is free and open-source, while Visual Studio Code requires a paid license.
  • Visual Studio is designed for web development, while Visual Studio Code is for desktop application development.
The primary distinction between Visual Studio and Visual Studio Code is that Visual Studio is a full-featured integrated development environment (IDE) with a wide range of features for various types of development, whereas Visual Studio Code is a lightweight, open-source code editor with extensibility for customizing and configuring it according to the developer's needs.

You're considering ASP.NET Core for a new web project because you've heard it's lightweight. What does "lightweight" mean in this context?

  • Reduced Memory Usage
  • Small Download Size
  • Limited Functionality
  • Short Development Time
In the context of ASP.NET Core, "lightweight" refers to reduced memory usage and a small download size. ASP.NET Core is designed to use fewer system resources, making it efficient for hosting applications and reducing operational costs. This lightweight nature also allows faster startup times for applications.

To serve static files, one must configure the necessary _________ in the Startup.cs file.

  • Middleware
  • Route
  • Controller
  • Model
To serve static files in ASP.NET Core, you need to configure the necessary middleware in the "Startup.cs" file. Middleware is a key concept in ASP.NET Core for handling requests and responses.

Where is the configuration for routes primarily done in an ASP.NET Core MVC application?

  • In the Startup.cs file
  • In the Views folder
  • In the appsettings.json file
  • In the Program.cs file
In an ASP.NET Core MVC application, the configuration for routes is primarily done in the Startup.cs file. In the Configure method, developers define route patterns and specify which controller and action should handle incoming requests, enabling the routing system to map URLs to controller actions.

A client requires that certain parts of your application should be accessible only via specific subdomains. How can attribute routing in ASP.NET Core help achieve this requirement?

  • Utilize Route Constraints
  • Implement Custom Route Handlers
  • Apply Route Attributes to Subdomains
  • Use Route Areas
To restrict certain parts of your application to specific subdomains using attribute routing, you can utilize Route Constraints. By defining constraints on route parameters like {subdomain}, you can ensure that certain routes are accessible only when the subdomain matches the required value, fulfilling the client's requirement for subdomain-based access control.

Which Azure service is specifically tailored for deploying Docker containers?

  • Azure Kubernetes Service (AKS)
  • Azure Functions
  • Azure App Service
  • Azure Cosmos DB
Azure Kubernetes Service (AKS) is tailored for deploying Docker containers. It's a managed Kubernetes container orchestration service that simplifies deploying, managing, and scaling containerized applications using Kubernetes.