Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 8 publish ASP.NET core application - file in use

Is it possible to publish an ASP.NET (core) application to a running site on IIS 8 without having to stop and start the website manually?

Visual Studio 2015 keeps giving the error that a file is in use. I'm using publish to the file system, because my Web Deploy to a server in our network fails at the end with an error that it cannot authenticate on the server with port 443.

I don't mind IIS having to recycle the application pool, but when I constantly have to put the app down, publish (which takes about a minute) and restart it, it's not really good for the users.

Another option would be something like 2 websites running the same application, but only if this is automatable. Then it would put down 1 of the 2, update this, put it on, put down the second, update this and start it.

A third option is something like a hot update, where I could just update the application while it being on.

Can anyone point me in the right direction (perhaps some blog posts), because my Google searches didn't give me any good information?

like image 403
Appsum Solutions Avatar asked Oct 11 '16 07:10

Appsum Solutions


1 Answers

If you copy a file called app_offline.htm to the application folder IIS will gracefully stop your application and start serving the contents of the app_offline.htm file. When application is stopped you can copy your files. After files are copied remove the app_offline.htm file and IIS will start your app. VS does that for you when you deploy to Azure but not when deploying to file system.

like image 123
Pawel Avatar answered Oct 15 '22 14:10

Pawel