Under ASP.NET with .NET Framework, you can perform a "hot deploy" of new code without disruption. This works because IIS can juggle multiple app domains for the same application: when new code arrives it "drain stops" the old app domain, allowing it to finish requests while simultaneously the new app domain starts up and starts serving new requests.
My question is: is there any parallel to this in ASP.NET Core with Kestrel? If so, what?
In general, to deploy an ASP.NET Core app to a hosting environment: Deploy the published app to a folder on the hosting server. Set up a process manager that starts the app when requests arrive and restarts the app after it crashes or the server reboots. For configuration of a reverse proxy, set up a reverse proxy to forward requests to the app.
ASP.NET Core is a free, open source, and cross-platform web development framework provided by Microsoft. It is not an upgraded version of ASP.NET but it is a completely rewritten framework from scratch which comes with a single programming model for ASP.NET MVC and ASP.NET Web API. Here, I am not going to discuss ASP.NET Core and its features.
Advantages of Using IIS with ASP.NET Core Hosting. Microsoft recommends using IIS with any public facing site for ASP.NET core hosting. IIS provides additional levels of configurability, management, security, logging, and many other things.
In this case, a new ASP.NET Core app is created and hosted in IIS as a separate web application within the existing ASP.NET MVC web site. Since it will be added as a child of the original web site and will be named api, its default route should no longer begin with api/.
Kestrel doesn't have this built in like IIS does. Think about it: Kestrel binds directly to port 80. You have to start a new Kestrel process to update your code. Those processes can't share port 80 and there is no way to hand it off from one process to the other without a reverse proxy in front of both.
You could use a load balancer in front of your webservers. Then do a rolling update or a blue-green deployment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With