ASP.NET Core Hosting Models
Hosting model defines how the application starts, how the requests are processed, and how the responses are returned to the clients i.e. hosting and execution
There are two types of hosting models
- InProcess hosting model
- OutOfProcess hosting model
Let’s go into details
1.InProcess hosting model:
ASP.NET core model : It is native IIS model which integrates ASP.NET core application with IIS server
Here , Web application hosted inside the IIS worker process (w3wp.exe).IIS server handles web requests
Application code and IIS worker process share same memory space so It eliminates communication overhead between web server and application process that’s why it has better performance than out of process hosting model
You can use InProcess hosting model by adding <AspNetCoreHostingModel> in a <PropertyGroup>
2.OutOfProcess hosting model :
Here web application runs in a process which is separate from web server process
Get Chetan Badgujar’s stories in your inbox
Join Medium for free to get updates from this writer.
There are two web server
- Internal Web Server (Kestrel)
- External Web Server(IIS, Nginx, Apache)
What is kestrel?
It is lightweight, cross-platform web server built for ASP.NET core application. by default it is included web server
kestrel server can be used as
- Internet facing web server
kestrel directly process the incoming web request and no external server needed
2. As a Internal Web Server
Kestrel is used as internal web server with reverse proxy server like IIS , apache.
Reverse proxy adds additional layer of configuration and security and maintains load balancing
You can use OutOfProcess hosting model by adding <AspNetCoreHostingModel> in a <PropertyGroup>
Thanks for reading…








