ASP.NET Core Test 2

0%

The ASP.NET core web application's host is set up in the________ file.

Correct! Wrong!

Explanation:
The application begins at Program.cs. The Program.cs file will behave similarly to the Program.cs file in a traditional.NET Framework console application. The Program.cs file is the application's entry point, and it will be responsible for registering Startup.cs, IISIntegration, and the Main method's Create a host using an instance of IWebHostBuilder.

In the.NET Core command line interface, every command begins with ____.

Correct! Wrong!

Explanation:
The dotnet driver is the starting point for all.NET Core CLI commands. The provided command is started by the driver, i.e. dotnet. Following dotnet, we must supply the command (also known as the verb) that will be used to carry out a certain activity.

In an ASP.NET Core application, which of the following is run on each request?

Correct! Wrong!

Explanation:
A middleware is a component (class) in an ASP.NET Core application that is executed on every request. HttpHandlers and HttpModules were part of the request pipeline in traditional ASP.NET. HttpHandlers and HttpModules are similar to middleware in that both must be configured and run in each request.

Middlewares can be set up in _____ Startup class's method.

Correct! Wrong!

Explanation:
Middleware configuration Using an IApplicationBuilder instance, we can set up middleware in the Startup class's Configure method. On each request, the following example uses the Run function to add a single middleware that returns the string "Hello World!"

To serve static files in an ASP.NET Core application, which middleware must be installed?

Correct! Wrong!

Explanation:
To support static resources, an ASP.NET Core Application's application request processing pipeline must be configured with a middleware called UseStaticFiles (). The UseStaticFiles () middleware is an ASP.NET Core Framework intrinsic middleware that handles static files in an ASP.NET Core Application.

We need to obtain ______object from IoC container to create logs in an ASP.NET Core application.

Correct! Wrong!

Explanation:
ILogger and ILoggerFactory were added in.NET Core to provide a layer of abstraction for developers to use when adding logging to their applications.
To record messages from the logging abstraction, the application can choose from a number of logging providers. These can save log messages in a variety of file formats, include extra information (such as the machine name), or transfer the messages to a log server for storage.

Without the.NET Core runtime, a program can be installed and run on any platform.

Correct! Wrong!

Explanation:
Application that is self-contained Self-contained applications include the.NET Core runtime when they are published. It can execute on a computer that is missing the.NET Core runtime.

Which of the following extension methods enables us to set up a custom error handling route?

Correct! Wrong!

Explanation:
We can configure a custom error handling route using the UseExceptionHandler extension function. When an application is used in a production environment, this is useful.

By default, an ASP.NET Core web application utilizes _____as an internal web server.

Correct! Wrong!

Explanation:
Kestrel is a cross-platform web server that supports ASP.NET Core. It's compatible with all.NET Core platforms and versions. In ASP.NET Core, it comes preinstalled as an internal server. Kestrel can be used as an edge server, which is an Internet-facing web server that can process client HTTP requests directly. The program is hosted by the dotnet.exe process in Kestrel.

Premium Tests $49/mo
FREE April-2024