Project Setup and Hosting Mode in DotNet Core
ASP.NET Core is the framework that can be used
for web development with .NET. If you have any experience with MVC or Web API
over the last few years. Let's discuss how to create a new project in Visual
Studio 2017.
To start with Dot net core project just add a
new project from VS2017 and select empty project option.
Select application type as per your
requirement here I am selecting empty application.
Your project is created and available in
solution explorer and physical location as well.
For me it’s available in F drive of my system.
Here you will see few files which comes by default while creating a dotnet core
application. These files are code files having default name Program and Startup.
Here one more default file (launchsettings.json) is created which have IIS settings and profile information of your application.
Dotnet core application have two type of
hosting one is In-Process and second is OutProcess. These options can be
configured from project configuration file which you can open from solution explorer
by right click and select edit your project file as below.
Your application could be run through VS
solution and command prompt as well. To run your application please use command
dotnet run.
Output:
To check the project configuration file just right click on your project in solution explorer and click on editProjectFileName.config option. You will see the configuration file with few settings.
Once you open this file then one tag AspNetCoreHostingModel will be available there in the configuration
file.
In-Process
Hosting Mode
In this hosting mode application will be host
inside the IIS worker process. There will be one web server. This approach also
better in terms of application performance.
Out
of Process Hosting Mode (Default Hosting)
In this hosting mode you will have two web
server one is internal and second is external. Internal web server will be Kestrel
and external web server could be IIS, apache, engine-ex which will be used as
per the requirement.
Kestrel server by default configured with
dotnet core setup. Which directly interact with internet or we can say internet
facing web server.
Kestrel can be used with reverse proxy server
for load balancing or scaling the application.
I hope you got the basic understanding to
start with Dotnet core application with available application hosting options.
I will explain more on dotnet core in my next article.
Happy
Learning!!!
Comments
Post a Comment