IIS 8 publishes ASP.NET core application - file used

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

Visual Studio 2015 continues to give an error that the file is being used. I use publishing on the file system because my web deployment on a server on our network fails with an error that it cannot authenticate on the server with port 443.

I don't mind IIS having to re-process the application pool, but when I constantly have to add an application, publish (which takes about a minute) and restart it, this is not very good for users.

Another option is something like two websites working with the same application, but only if it is automated. Then he would set aside 1 of 2, update it, put it down, put the second one, update it and start it.

The third option is something like a hot update, where I can just update the application while it is turned on.

Can someone point me in the right direction (maybe some blog posts) because my Google searches did not give me any good information?

+6
source share
2 answers

If you copy the app_offline.htm file to the application folder, IIS gracefully stops your application and starts serving the contents of the app_offline.htm file. When the application is stopped, you can copy the files. After copying the files, delete the app_offline.htm file and IIS will launch your application. VS does this for you when deploying to Azure, but not when deploying to the file system.

+1
source

You mentioned "two websites running the same application." Do you mean two web servers with the same application?

If you already have several web servers (aka server cluster or web farm), you can simply pull out several servers from the cluster and upgrade them. That is how we push our updates. We use Citrix software to manage the server farm. It also supports load balancing. This type of software allows you to control servers, so you can determine when all users have "moved" from web servers (which were recently removed from the cluster). Then you can run iisreset, deploy a new assembly, and go to the next server (or set of servers, depending on your configuration). We have over 20 virtual web servers. Usually we remove half of the servers, update them and occupy the second half when we return the first half to the cluster / farm. This should provide continuous service. I understand that you want to automate the process. Suppose you are using Windows NLB (Network Load Balancing). You can write a PowerShell script to automate server removal. Here is the link: https://technet.microsoft.com/en-us/library/ee817138

I understand that this can be seen as a workaround. I'm not sure if the application pool utility is always needed with ASP.NET Core. I could not find a definitive answer. In any case, most production applications should be on multiple web servers. Even if you have few users, you should have several web servers for fault tolerance.

0
source

All Articles