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.

Which file in an ASP.NET Core project acts as the entry point of the application?

  • Startup.cs
  • Program.cs
  • appsettings.json
  • Controller.cs
In an ASP.NET Core project, the "Program.cs" file serves as the entry point of the application. It contains the Main method, which creates the web host and starts the application. This is where the application configuration and host building occur before the application starts listening for incoming requests.

In which part of an MVC application would you typically find attribute routes?

  • Controller Actions
  • Views
  • Models
  • Middleware
Attribute routes are typically found in Controller Actions within an MVC application. Controllers use attribute routing to define custom routes for their action methods, which can be more readable and maintainable than convention-based routing.

You are building a small website using ASP.NET Core MVC. For displaying data to the users, which component of the MVC pattern should you focus on?

  • Model
  • View
  • Controller
  • Routing
In the MVC (Model-View-Controller) pattern, the "View" component is responsible for displaying data to users. It defines the structure and layout of the web pages, presenting data from the model in a user-friendly format. Controllers handle the request processing, but views handle the presentation of data to the users.

Your team has been asked to develop a CMS platform where the frontend and backend logic is closely intertwined. Which ASP.NET Core project structure would be best suited for this?

  • MVC
  • Razor Pages
  • Web API
  • Blazor Server
For a CMS platform where frontend and backend logic are closely intertwined, the MVC (Model-View-Controller) project structure would be the most suitable choice. MVC allows for the seamless integration of frontend and backend components, making it easier to manage complex interactions and maintain a unified user experience.

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.