0

I have a website that running locally on IIS Manager. Every time when I update website, I communicate client via Anydesk and update its file. Whenever the client got any update from server than it should be automatically updated.

I got it solution to push dll file on GitHub. When customer click on update button GitHub file download automatically in where website hosted folder. The problem is here when I replace updated file, it will give an error 'The process cannot access file, because it already used'.

a

If this solution is correct, kindly guide me how to overwrite file while application running on IIS manager without stop application

Otherwise give me suggestion to update file from online window server to local IIS manager without closing application.

Ahsan farooq
  • 107
  • 1
  • 10
  • The best way to do this would be to run a Windows Service as a Local System. Have that periodically check for updates. Once detected, it would stop the site, replace the files, start the site. – zaitsman Sep 30 '21 at 07:49
  • I want to update file automatically without stop application. – Ahsan farooq Sep 30 '21 at 07:51
  • Client not replace file or folder locally and i also not want to access his system personally. – Ahsan farooq Sep 30 '21 at 07:53
  • my dude it's IIS. you can't replace files that IIS is using, you HAVE to stop the site :) – zaitsman Sep 30 '21 at 07:59
  • Add in webconfig fcnMode="Single" may be this will help. https://stackoverflow.com/questions/56340790/why-in-iis-8-5-fcnmode-disabled-not-works-any-edit-of-web-config-cause-appll – BASKA Sep 30 '21 at 08:08
  • I am working in .net core 5.0 and this solution is for .net framework – Ahsan farooq Sep 30 '21 at 08:15

2 Answers2

0

Currently, in ASP.NET Core apps, it is impossible to replace binaries when the application is still running, but it will possible in .NET 6 by Shadow-copying in IIS.

0

You should consider the Blue Green deployemnt for your app https://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html Options that I can suggest for your:

vshandra
  • 148
  • 1
  • 7