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

G’day, I’m a technical solutions consultant based in Perth, Australia that specialises in the Microsoft technology stack, including .NET, Dynamics 365, Azure and general web development etc.

This blog is my place to share my thoughts, helpful solutions and just random nerdy stuff.
Shane Bartholomeusz

Latest posts by Shane Bartholomeusz (see all)