ASP.NET Core › Hosting Models: Kestrel, IIS & Reverse Proxies
What is the difference between the in-process and out-of-process hosting models when running an ASP.NET Core application under IIS?
IntermediateAnswer
In-process hosting runs the ASP.NET Core application directly inside the IIS worker process (w3wp.exe) via the AspNetCoreModuleV2, avoiding an extra network hop and providing better performance (the default and recommended model since .NET Core 3.0) -- out-of-process hosting instead runs Kestrel as a separate process, with IIS acting purely as a reverse proxy forwarding requests to it, useful in scenarios needing process isolation from IIS itself or when running on an older hosting model.
<!-- web.config -->
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll"
hostingModel="inprocess" /> <!-- default, better performance -->
<!-- Alternative: out-of-process -->
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll"
hostingModel="outofprocess" />Real-world example A high-throughput internal API hosted on IIS explicitly confirms it's using in-process hosting (the default) to avoid the extra reverse-proxy hop and process overhead that out-of-process hosting would introduce, since raw request throughput is a priority.