MVC Core - What is the difference between UseIIS and UseIISIntegration
Refer the blog from "Rick Strahl" with cool mind and you will find it very easy.
for the differences between out-of-process and in-process hosting in his blog post here
https://weblog.west-wind.com/posts/2019/Mar/16/ASPNET-Core-Hosting-on-IIS-with-ASPNET-Core-22
Until ASP.NET Core 2.2, ASP.NET Core was hosted out-of-process in IIS, meaning we had two processes for an application:
w3wp.exe
, the IIS process; anddotnet.exe
, the ASP.NET Core process, where the Kestrel web server was started.
This means that IIS and Kestrel were communicating between those two processes.
For this scenario, you would use UseIISIntegration
.
ASP.NET Core 2.2 introduced in-process hosting, where your ASP.NET Core app is ran inside of the IIS w3wp.exe
process, removing the need for the Kestrel web server, in which case you want to use UseIIS
.
Notes:
- the official documentation seems to indicate that the
CreateDefaultBuilder
method will call the appropriate method by itself; see https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2#enable-the-iisintegration-components - Rick Strahl has some nice diagrams to show the differences between out-of-process and in-process hosting in the following blog post: https://weblog.west-wind.com/posts/2019/Mar/16/ASPNET-Core-Hosting-on-IIS-with-ASPNET-Core-22