How to publish asp.net core app Dlls without having to stop the application

时光怂恿深爱的人放手 提交于 2021-02-04 22:10:23

问题


When i try to publish the .net core app Dlls using ftp via filezilla tool it shows an error message that the file is in use by another process.

It's understandable that the above message shows because the the file is used by dotnet.exe which is a separate process.

To overcome the issue i have to stop the application in iis each time then upload the dlls and then restart it. Due to which a very small down time is experienced , the asp.net identity session expires and it needs rdp to the server each time upload is needed.

It's also not smooth experience in comparison to asp.net mvc where we could publish the files directly without need to RPD or do some manual action.

Any work around or solution to overcome to the above issues will be appreciated.


回答1:


Well, if you had two servers behind a load balancer, you could do (simplified):

  1. Remove server 1 from LB
  2. Stop app on server 1
  3. Update server 1
  4. Add server 1 back to the LB
  5. Repeat 1-4 for server 2

This is called a rolling upgrade.




回答2:


Got the solution.

It can be done via the app_offline.html file.

You have to move the app_offline.html file to application root folder to stop/make offline the application.

Then you can push your changes and remove the app_offline.html file from application root folder.

Note: You can put some informative message in the app_offline.html file which will be shown to user that maintenance is on progress.



来源:https://stackoverflow.com/questions/40277924/how-to-publish-asp-net-core-app-dlls-without-having-to-stop-the-application

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