DEV Community

loading...
Cover image for ASP.NET Core 3 deploy to Windows IIS mode changed

ASP.NET Core 3 deploy to Windows IIS mode changed

shps951023 profile image Wei ・2 min read

I recently upgraded the ASP.NET Core 2.1 project in windows server to version 3.1, and found that the windows install on IIS way has changed.

First. In addition to Reverse proxy, since ASP.NET Core 3.0 has default in-process-hosting support for IIS ( reference ), you don't need to use IIS Pool CLR no managed code ( reference ), you can only rely on kestrel server to run the web engine.

Kestrel can now be removed. that's mean it can avoids data translation between IIS and Kestrel, it can provides better performance and less resource , the relevant performance test can be referred to ( Rick Strahl article )

This is good news for who must continue to use the windows server and cannot replace by Linux!

Second. Note that IIS In-process hosting each app needs to set a unique pool, it not likes asp.net mvc, multiple applications can use the same pool to manage.

For this, you can refer to the answer I asked Brando Zhang on S.O

Sharing an app pool among apps isn't supported. Use one app pool per app.

Otherwise there will be an error HTTP Error 500.35 - ANCM Multiple In-Process Applications in same Process

Third. Although ASP.NET Core 3.1 can be packaged into a self-contained single file with the Runtime environment, it is unfortunately only work for the kestrel server. IIS Server without Runtime still needs to be installed Hosting Bundle .

There is no way to one file like .net core console and others can use it out of the box.

Image: The asp.net core app containing runtime dll runs as kestrel on a server without runtime installed

Image: If the same file runs on IIS, it will report 500.19 error

Discussion

pic
Editor guide