Pre Course Home Next

Asp.Net Core Interview Questions Tutorial

Asp.Net Core Interview Questions - Part 1

Q. What is Asp.Net Core?
A. Asp.Net core is a web development framework developed by Microsoft. It is an open source and cross platform framework, so applications can be developed using asp.net core on Windows, Linux and Mac.
It is complete rewrite from scratch of previous asp.net framework based on .Net framework. Asp.Net core is built on top of .Net Core framework.

Q. What are main features of .Net Core Framework?
A. 
.Net core have following features:

  • Cross-platform: Applications made using .Net core can be deployed on Windows, MacOS and Linux. Same way applications can be developed on any of these OS platforms.
  • .Net Compaitble: .Net Core is compatible with .Net framework, this is done by targeting standard .Net library. Same way it is compatible with Xamarine and Mono framework.
  • Command Line Tools: .Net Core comes with inbuild CLI which gives it power to develop applications using just a simple text editor and command line tools, so no expensive IDE is required anymore.

Q. What is the latest version of Asp.Net Core?
A. Asp.Net core 5.0 is the latest release.

Q. What are the changes in latest version of Asp.Net core?
A.
In the latest version, package.json is removed. Now .csproj is used. Also now MSBuild is used to build the application.

Q. What is the basic project type of asp.net core applications.
A.
Every .net core application is basically a console application, so is asp.net core. Every asp.net core application has main method which is the entry point of the application.

Q. Where is the entry point of asp.net core projects.
A.
 Every asp.net core application has main method in program.cs file, which is the entry point of the application. Inside this main method a web host is configured which accepts web requests and send response.

Q. What is the use of webHostBuilder class? Where it is used in Asp.Net core project?
A. 
WebHostBuilder class is used to create and configure the host for the application. This host will handle the HTPP request. WebHostBuilder class is used in main method of the program.cs file.

Q. What web servers are shipped with asp.net core?
A. 
WebHostBuilder Asp.Net core is shipped with two server implementations:
    1 - Kestrel
    2 - WebListner

Q. What frameworks asp.net core can target?
A. Asp.Net core can target .NET core and full .NET frameworks both.

Q. At what location static files are stored in Asp.Net core application? How we can change the default static folder location?
A. Asp.Net core saves the static files in wwwroot folder in the root of the project. This can be changed with help of UseWebRoot.

Q. What is middleware?
A. Middleware are used to handle the HTTP requests in the application. Each HTTP request is went through the middleware pipeline. Each middleware performs individual logic on HTTP request. A middleware can return a response. If middleware doesn’t have a response then it passes the request to next middleware. Example of middleware are MVC, static file, logger etc.

Q. What is the use of Configure() method in startup file?
A. Configure method is used to handle the request pipeline in asp.net core applicaction. Middleware are used to handle the HTTP requests in the application, so all middleware are used inside this method.

 

Pre Course Home Next