ASP DotNet Core

ASP DotNet Core

1) ASP.NET Core is an ____________ framework.
Answer: Open-sourced

2) What is the entry point of ASP.NET Core application?
Answer: Main method of Program class

3) By default, static files can be served from __________ folder.
Answer: wwwroot

4) The host for ASP.NET Core web application is configured in _________ file.
Answer: Program.cs

5) ASP.NET Core web application uses __________ as an internal web server by default.
Answer: Kestrel

6) Every command in .NET Core command line interface starts with _________.
Answer: dotnet

7) The Startup class must include _________ method.
Answer: Configure

8) The _________ method in Startup class is used to registering services with IoC container.
Answer: ConfigureService

9) Middlewares are executed on each request in ASP.NET Core application.

10) Middlewares can be configured using instance of type ____________.
Answer: IApplicationBuilder

11) Middlwares can be configured in ___________ method of Startup class.
Answer: Configure

12) ASPNETCORE_ENVIRONMENT is environment variable in ASP.NET Core application.

13) Which of the following extension method allow us to configure custom error handling route?
Answer: UseExceptionHandler

14) Which middleware must be installed to serve static files in ASP.NET Core application?
Answer: Microsoft.AspNetCore.StaticFiles

15) ___________ applications can be installed and run on any platform without .NET Core runtime
Answer: Self-contained

16) We should target which of the following for the code sharing of .NET Core application?
Answer: .NET Standard

17) To create logs in ASP.NET Core application, we need to get _________ object from IoC container.
Answer: ILogger

18) What are the features of MVC5?

A. Scaffolding
B. ASP.NET Identity
C. One ASP.NET
D. All of the above

19) ASP.NET Core applications can target which of the following?
A .NET Core
B .NET Framework 4.x
C .NET Standard
D All of the above

20) ASP.NET Core supports which of the following platforms?
A Windows
B Linux
C Mac
D All of the above

21) Can ASP.NET Core work with the .NET framework? Can ASP.NET Core work with the .NET framework?
Answer
Yes. This might surprise many, but ASP.NET Core works with .NET framework and this is officially supported by Microsoft.

ASP.NET Core works with:
.NET Core framework
.NET framework

22) What Are Technologies Discontinued In .net Core?

Answer :

  • Reflection
  • Appdomain
  • Remoting
  • Binary serialization
  • Sandboxing

23) What Are The Various Json Files In Asp.net Core 1?
Answer :
a) global.json: can define solution level settings in global.json file

b) launchsettings.json: can define project specific settings associated with each profile Visual Studio is configured to launch the application, including any environment variables that should be used. You can define framework for your project for compilation and debugging for specific profiles.

c) appsettings.json: to store custom application setting, DB connection strings,Logging etc

d) bundleconfig.json: can define the configuration for bundling and minification for the project.

e) project.json: storing all project level configuration settings

f) bower.json: Bower is a package manager for the web. Bower manages components that contain HTML, CSS, JavaScript, fonts or even image files. Bower installs the right versions of the packages you need and their dependencies

24) project.json files are no longer supported in .NET Core 2. Instead, .NET Core apps now use csproj files.

The .NET Core (and other teams) have decided to drop project.json and go back to MSBuild and *.csproj.

global.json is still in stack, but neutered to only defining the SDK version. Previously, it replaced the *.sln.

25) You can now edit the .csproj file directly without unloading the project

26) Explain Startup Process In Asp.net Core?

Answer :

Everything starts from Program.cs

public static void Main(string[] args)
{
BuildWebHost(args).Run();
}

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup()
.Build();

CreateDefaultBuilder extension method will create a default configuration which will look first into appsettings.json files then will look for Environment variables and at the end, it will use command line arguments.

This part will also set up default logger sources (debug and console) and load the settings for logging from appsettings.json.

After the CreateDefaultBuilder finishes, then Startup class is executed. First, the constructor code is executed. After that, services are added to DI container via AddServices method that lives in Startup class. After that, an order of middleware that will handle every incoming request is set up.

Leave a comment