问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/55503897/is-it-possible-to-smoothly-hot-deploy-an-asp-net-core-app