Sitemap
Chetan Badgujar

Chetan Badgujar

Technology evangelist and coding enthusiast. Exploring the basic coding concepts and sharing insights on the future of programming.

ASP.NET Core Hosting Models

2 min readMay 21, 2024

--

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

  1. InProcess hosting model
  2. OutOfProcess hosting model

Let’s go into details

1.InProcess hosting model:

Press enter or click to view image in full size

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>

Press enter or click to view image in full size

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

  1. Internal Web Server (Kestrel)
  2. 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

  1. Internet facing web server
Press enter or click to view image in full size

kestrel directly process the incoming web request and no external server needed

2. As a Internal Web Server

Press enter or click to view image in full size

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…

--

--

Chetan Badgujar
Chetan Badgujar

Written by Chetan Badgujar

Technology evangelist and coding enthusiast. Exploring the basic coding concepts and sharing insights on the future of programming.