Overview

There are times where you may need to take an ASP.NET application offline to perform maintenance.

In this post I’ll show you how to do exactly that using the out-of-the-box capabilities of IIS / ASP.NET.

ASP.NET Logo

How To:

Create a HTML file called “app_offline.htm” in the root directory of the web application. IIS will recognise this special file and immediately suspend all web requests for the site and instead display the contents of the app_offline.htm file to the client.

Create a HTML file called “app_offline.htm” in the root directory of the web application. IIS will recognise this special file and immediately suspend all web requests for the site and instead show the app_offline.htm file to the client.

To bring the application out of “maintenance mode” simply remove the file. Nice and easy 🙂

Final Thoughts

Hope this post helps.

More information can be found at the below link:
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/advanced-enterprise-web-deployment/taking-web-applications-offline-with-web-deploy

Shane Bartholomeusz