How to update a running asp.net core application?

谁都会走 提交于 2020-06-25 03:26:09

问题


I have a Asp.Net Core MVC application running on Windows Server 2008 R2 with IIS. But every time I update this application, I need to manually stop the applicationPool in IIS, and restart the applicationPool after I finish updating the app. Otherwise it will tel me "the xxx.dll is in use by other progress".

Is there any way to make this process easier?


回答1:


Finally I found my anwser:
I just need add a file named app_offline.htm to the IIS web root(not your project wwwroot folder). due to this issue you may need try both App_Offline.htm or app_offline.htm .




回答2:


Opening the web.config file in an editor and saving it will cause the web application to reload, even if you don't change anything. All DLLs should be replaceable, until a user hits the site, causing the web application to start again. I sometimes use that as a workaround.

A more full fledged solution would be to use Web Deploy, either through Visual Studio or by command line. This can take a litte while to set up, but offers more automation.

https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#deploy-the-application-1




回答3:


There is no way to hotswap in place DLL's.

Your best bet is to deploy to a new folder each time (For example a versioned folder), and change the website directory in IIS once you have fully copied your website onto the server.



来源:https://stackoverflow.com/questions/43951276/how-to-update-a-running-asp-net-core-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!