Which of the following files replaced project.json in .NET Core 2.0 and later versions?

  • .csproj
  • .config
  • .jsonproj
  • .xmlproj
The project.json file was replaced by the .csproj file in .NET Core 2.0 and later versions. .csproj files use XML to define project structure and dependencies, replacing the simpler JSON-based project.json format.

In attribute routing, the [Route("products/{id}", Order = 2)] attribute will prioritize this route ______ other routes with no order specified.

  • over
  • above
  • before
  • instead of
In attribute routing, when specifying the 'Order' property, a lower value indicates a higher priority. So, the route with 'Order = 2' will prioritize this route above other routes with no order specified. This allows you to control the order in which routes are matched and executed.

If you wanted to change the way request logging is done in an ASP.NET Core application, which file would you typically modify?

  • appsettings.json
  • Startup.cs
  • Program.cs
  • launchSettings.json
To change the way request logging is handled in an ASP.NET Core application, you typically modify the Startup.cs file. This is where you configure various aspects of your application, including logging middleware and settings.

To manage application secrets without storing them in the source code, ASP.NET Core introduced the _________ manager.

  • Secret
  • Configuration
  • Identity
  • Credential
To manage application secrets without storing them in the source code, ASP.NET Core introduced the Configuration manager. This manager allows developers to store sensitive information like connection strings, API keys, and passwords outside of the codebase, typically in environment variables or configuration files. It enhances security and facilitates configuration management.

Which default folder in an ASP.NET Core web application is used to store and serve static files like CSS, JavaScript, and images?

  • wwwroot
  • Views
  • Controllers
  • Models
The default folder for storing and serving static files in an ASP.NET Core web application is the 'wwwroot' folder. Files placed in this directory can be directly accessed by clients, making it an ideal location for assets like CSS, JavaScript, and images.

In a scenario where you want to optimize the response time of your web application, you decide to implement caching. Which middleware in ASP.NET Core can assist in this task?

  • UseResponseCaching middleware
  • UseMemoryCache middleware
  • UseDistributedCache middleware
  • UseStaticFiles middleware
To optimize the response time of a web application through caching in ASP.NET Core, you would typically use the UseResponseCaching middleware. This middleware enables caching of HTTP responses, allowing you to store and serve previously generated responses for improved performance. The other middleware options listed are used for different purposes, such as in-memory caching, distributed caching, or serving static files.

Razor views support ________, which allows for logic to be embedded directly within the HTML.

  • Razor Pages
  • Tag Helpers
  • C# Code Blocks
  • CSS Styling
Razor views support C# Code Blocks, which allow developers to embed server-side logic directly within the HTML markup. This is a powerful feature of Razor that enables dynamic content generation.

In which directory of an ASP.NET Core MVC application would you find the Razor view files?

  • Models
  • Controllers
  • Views
  • Data
In an ASP.NET Core MVC application, the Razor view files are typically located in the "Views" directory. These view files use the Razor syntax to define the HTML structure of the application's user interface. Views are responsible for rendering data provided by controllers to create the final web page that users interact with.

In Razor syntax, which character is used to denote the start of server-side code?

  • @
  • #
  • $
  • %
In Razor syntax, the "@" symbol is used to denote the start of server-side code. This allows developers to seamlessly transition between HTML markup and C# code within a Razor view.

When creating a new ASP.NET Core project, what does the "API" template primarily configure the project for?

  • A desktop application.
  • A web application with a user interface.
  • A web application primarily meant for exposing web APIs.
  • A mobile application.
The "API" template in ASP.NET Core is specifically designed to configure a project for building web applications that primarily expose web APIs. This template sets up the project with minimal middleware and settings for handling HTTP requests and responses, making it suitable for building RESTful APIs.