iTranslated by AI
Deploying ASP.NET Core Apps to IIS using the Out-of-Process Hosting Model
Introduction
Normally, when an ASP.NET Core application is deployed to IIS, it is processed in-process by default.
The advantage of in-process hosting is performance.
In-process hosting means the ASP.NET Core app runs in the same process as the IIS worker process. Therefore, requests are not proxied via a loopback adapter.

On the other hand, in out-of-process hosting, the ASP.NET Core app runs in a process separate from the IIS worker process.
Process management is handled by the ASP.NET Core Module. If you look at the Task Manager, you will see a process named dotnet.exe running. This process starts when the first request arrives, and the app is restarted if the process shuts down or crashes.

Generic Host Application Configuration
Enabling the IISIntegration Component
Usually, if you are using the template as-is, this should already be enabled.
You construct an IHost using CreateHostBuilder.
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
...
Project File Configuration
This must be configured.
If there is no setting, it defaults to in-process.
<PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
With this, CreateDefaultBuilder calls UseIISIntegration, which uses the Kestrel server and configures the host to capture startup errors and configure the port and base path that the server listens to when running behind the ASP.NET Core Module.
Trying it out
Behavior in In-Process
The IIS process memory usage is 18 MB.

There is no dotnet.exe process (sorted by process name).

Behavior in Out-of-Process
The IIS process memory usage is around 5 MB.

The dotnet.exe process is running.

Summary
By running it out-of-process, you can move the application out of the IIS process. I believe this has the effect of making it harder for application crashes to affect other things.
Also, by using a separate process, it becomes possible to host multiple applications from the same app pool.
Discussion