29

Looking at the codes, they have the same comments, suggesting that they do the same thing:

/// <summary>
/// Configures the port and base path the server should listen on when 
/// running behind AspNetCoreModule. The app will also be configured 
/// to capture startup errors.
/// </summary>

UseIIS is in Microsoft.AspNetCore.Server.IIS package, while UseIISIntegration is in Microsoft.AspNetCore.Server.IISIntegration.

What is the difference between the two? When do you need to use one versus the other? (or maybe both?)

UPDATE: There is a similar question on github, But there is no helpful answer there: https://github.com/aspnet/AspNetCore/issues/6197

2
  • Why is your question worded almost identically to this one on github?
    – jimSampica
    Commented Apr 15, 2019 at 13:09
  • See edit history
    – Hossein
    Commented Apr 15, 2019 at 13:13

2 Answers 2

49

Before ASP.NET Core 2.2, ASP.NET Core was hosted out-of-process in IIS, meaning we had two processes for an application:

  1. w3wp.exe, the IIS process; and
  2. dotnet.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:

5
  • 1
    Your answer is incomplete
    – Hossein
    Commented Apr 15, 2019 at 6:06
  • Yeah, sorry, I mistyped and submitted before I was done 🙇‍♂️ Commented Apr 15, 2019 at 6:40
  • So we don't need to call UseIIS for in process hosting?
    – jjxtra
    Commented Mar 3, 2020 at 21:25
  • 1
    thanks Michkael for sharing reference link of Rick's blog that is really informative Commented Apr 21, 2020 at 19:36
  • Excellent article thanks for sharing. Kudos to Rick as well Commented Nov 12, 2022 at 4:44
1

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

1
  • This answer does not cover the question, the blog does not discuss 'UseIISIntegration'
    – numX
    Commented Sep 2, 2020 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.