问题
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):
- Remove server 1 from LB
- Stop app on server 1
- Update server 1
- Add server 1 back to the LB
- 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