The project.json file was prevalent in ASP.NET Core versions prior to _________.

  • ASP.NET Core 1.0
  • ASP.NET Core 2.0
  • ASP.NET Core 3.1
  • ASP.NET 4.0
The project.json file was used in ASP.NET Core 1.0, but it was replaced with a different project file format starting from ASP.NET Core 2.0.

To enable MVC in ASP.NET Core's Startup.cs, which method should be invoked inside the ConfigureServices method?

  • services.AddMvc()
  • services.UseMvc()
  • services.ConfigureMvc()
  • services.EnableMvc()
To enable MVC in ASP.NET Core, you should invoke the services.AddMvc() method inside the ConfigureServices method of the Startup.cs class. This method configures MVC services, such as routing, controllers, and view engines, making MVC available in your application.

The _________ tool in ASP.NET Core is particularly useful for tasks like building the application, running migrations, or scaffolding items.

  • .NET CLI
  • Entity Framework
  • MSBuild
  • Visual Studio
The .NET CLI (Command Line Interface) in ASP.NET Core is a powerful tool for various development tasks. It allows developers to build, test, run, and manage ASP.NET Core applications from the command line. Tasks such as building the application, running database migrations, or scaffolding code can be efficiently accomplished using the .NET CLI.

What command would you typically use to create a new ASP.NET Core web application using the .NET Core CLI?

  • dotnet new web
  • dotnet build
  • dotnet run
  • dotnet publish
The correct command to create a new ASP.NET Core web application using the .NET Core CLI is dotnet new web. This command sets up a basic web application template for you to start building upon.

When creating custom Razor tag helpers, the method _________ is overridden to generate the desired output.

  • Process
  • Execute
  • Generate
  • Handle
When creating custom Razor tag helpers in ASP.NET Core, you override the "Execute" method to generate the desired HTML output. This method is called when the tag helper is encountered in a Razor view, allowing you to customize the generated content.

The _______ directive in _ViewImports.cshtml is used to include a namespace across multiple Razor views.

  • @using
  • @model
  • @section
  • @namespace
In ASP.NET Core Razor views, the @using directive is used to include a namespace that can be accessed across multiple views. This is useful for making classes, methods, or extensions from the namespace available in your views.

You're noticing that despite having global exception handling set up in your ASP.NET Core application, certain exceptions aren't being caught. What might be a plausible reason for this behavior and how can you ensure all exceptions are captured?

  • Some exceptions may occur before the middleware pipeline
  • Certain exceptions bypass the UseExceptionHandler middleware
  • Exception filters are causing conflicts
  • There is a bug in the .NET Core runtime
In ASP.NET Core, some exceptions, such as those occurring early in the middleware pipeline, may bypass the UseExceptionHandler middleware. These include exceptions during routing and model binding. To ensure all exceptions are captured, consider using other middleware or filters to catch exceptions at different stages of the request pipeline.

How can you enforce password complexity rules when programmatically creating users in ASP.NET Core?

  • A custom password validation method
  • Password complexity policies
  • Manually validate password strength
  • Use default password settings
In ASP.NET Core Identity, you can enforce password complexity rules by configuring password complexity policies. These policies allow you to specify requirements such as minimum length, required characters, and more. This ensures that passwords meet your defined criteria.

You're given the task to create a form in a Razor view that posts data to an MVC action named "Create" in the "Products" controller. Which built-in Tag Helper can help you generate the form's action attribute correctly?

  • asp-controller
  • asp-area
  • asp-route
  • asp-for
To generate the form's action attribute correctly, you can use the built-in Tag Helper "asp-controller" to specify the controller name, which in this case would be "Products." This helps ensure that the form posts data to the correct MVC action.

To ensure a column is always populated in the database but its value is automatically generated on insert or update, you should configure it as a _________ property.

  • Identity
  • Computed
  • AutoIncrement
  • Managed
To ensure that a column's value is automatically generated by the database during insert or update, you should configure it as a Computed property. This is useful for fields like timestamps or auto-incrementing primary keys in ASP.NET Core Entity Framework.