App_Offline.htm - Taking an ASP.NET 2.0 Application Offline

If you place a file named app_offline.htm in the root of a website/application directory, From ASP.NET 2.0+ the IIS will shut-down the application and stop normal processing any new incoming requests for that application, showing only the contents of the app_offline.htm file for all new requests.

This is the quickest and easiest way to display your "Site Temporarily Unavailable" notice while re-deploying (or rolling back) changes to a Production Live server (and you want to avoid the annoying problem of people hitting and activating your site in the middle of a content update).

It can also be a useful way to immediately unlock and unload a SQL Express or Access database whose .mdf or .mdb data files are residing in the /App_Data directory. Once you remove the app_offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and life will continue along as normal. Lets look at some example. I have created this simple App_offline.htm file.

The application is down for maintenance. Please try again in a while.
<!-- Add additional content to make this file bigger than 512 bytes... -->