As.Net core

Updated : Mar 15, 2020 in Articles

What is the Difference between Inprocess and OutOfprocess service in asp.net core

In this article, we will learn about what is the Difference between Inprocess and outOfprocess service in asp.net core 2.2 step by step

An Asp.net core Applications can be hosted into

  • InProcess
  • OutofProcess

Asp.net core InProcess Hosting:

Under default the hosting model for your asp.net core applications is InProcess

This means ASP.NET Core Module forwards the requests to IIS HTTP Server. The IIS HTTP Server is a server that runs in-process with IIS

Inprocess service in asp.net core

with InProcess hosting application is hosted inside the IIS worker process This response is better performance as compared to the OutOfProcess model.

In-process models bypass the built-in Kestrel web server of ASP.NET Core.

Asp.net core OutOfProcess Hosting:

If you want to use the OutOfProcess hosting model in your asp.net core Application then IIS HTTP Server won’t be used. in the OutOfProcess Hosting, Kestrel web server is used to process your requests.

The Kestrel is an open-source and cross-platform web server for the ASP.NET Core application. That means this Server supports all the platforms like Windows, Linux,macOS

kestrel can be used, by itself as an edge server and the process used to host the app is dotnet.exe

This means ASP.NET Core Module forwards the requests to Kestrel webserver compare to inprocess model outofprocess model in slower performance

OutOfprocess service in asp.net core

kestrel can be used in combination with a reverse proxy with two web server see the following given image

OutOfprocess service in asp.net core

Asp.net core applications are run without kestrel web severer also by default InProcess hosting model will work out of kestrel web server it will use IIS web server like w3wp.exe or iisexpress.exe

Difference between in-process and out-process

InProcessOutOfProcess
the request/responds process through is w3wp.exe or iisexpress.exethe request/responds process through dotnet.exe
It is using Single web serverit is using two webservers
great performancemany proxying requests between internal and external web servers

Introduction about asp.net Core 2.2