Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 644
Satyajit Avatar asked Oct 27 '16 06:10

Satyajit


2 Answers

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.

like image 119
juunas Avatar answered Nov 16 '22 17:11

juunas


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.

like image 37
Satyajit Avatar answered Nov 16 '22 16:11

Satyajit