14

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.

Satyajit
  • 2,150
  • 2
  • 15
  • 28
  • 1
    This whole issue is something that prevents sync/ftp/xcopy deployments... until this is solved, aspnetcore just is not as seemless as we all would want it to be! – Paul0515 Dec 30 '17 at 15:34
  • Workaround with requirement of RDP access is posted at https://stackoverflow.com/a/66580629/9659885 – Bharat Vasant Mar 11 '21 at 10:28

2 Answers2

4

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.

Satyajit
  • 2,150
  • 2
  • 15
  • 28
2

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.

juunas
  • 54,244
  • 13
  • 113
  • 149
  • Thanks, but it's a single server set up. I feel if there were something to do with permission by which the ftp client could write the changes even when the file is in use it could fix the issue. Above solution even for load balancer case is not smooth in comparison to the previous asp.net case as some manual work is involved. – Satyajit Oct 27 '16 at 07:01
  • No, this can all be automated using scripts. Actually this is what Stack Overflow does multiple times a day. – juunas Oct 27 '16 at 07:10
  • Not sure of that but as per this meta question http://meta.stackexchange.com/questions/10369/which-tools-and-technologies-are-used-to-build-the-stack-exchange-network , stackoverflow uses asp.net mvc 5, this question and issue is related to asp.net core mvc – Satyajit Oct 28 '16 at 07:28
  • Yes, it is a single server but it is really multiple *web servers*, IIS and Kestrel, so IIS really is a proxy server in front of N-number of Kestrel web servers, which invites all the same complications as using a load balancer. I'm struggling with automating the same issue, but my work around has been to deploy to a sibling folder (app1, app2, app3) and point IIS to the newest sibling. I can do it manually but I have not learned how to script it: http://stackoverflow.com/questions/41147302/how-can-i-update-asp-net-core-app-over-an-existing-running-site-without-stopping – flipdoubt Dec 14 '16 at 16:25