Click here to Skip to main content
13,149,756 members (85,512 online)
Click here to Skip to main content
Add your own
alternative version


1 bookmarked
Posted 11 Oct 2013

Application Offline

, 11 Oct 2013
Rate this:
Please Sign up or sign in to vote.
App_Offline.htm ASP.NET 2.0 introduced the ability to take an application offline simply by adding a file named App_Offline.htm to the

Editorial Note

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.


ASP.NET 2.0 introduced the ability to take an application offline simply by adding a file named App_Offline.htm to the application root folder.  ASP.NET checks for the presence of this file and, if it exists, stops the app-domain so the application cannot run.  In addition, ASP.NET returns the contents of App_Offline.htm to the requesting browser instead of issuing an IIS error message.  This provides a very neat and user-friendly method of taking an application offline for maintenance or updates.  To return the application to operating status, simply delete the file from the root of the application.

There are two issues to be aware of in using App_Offline.htm.  The first is that it is located in the root of the application, not the root of the web site.  So if your site is at and your application is at, you will need to place this file in the /application folder.  Placing the App_Offline.htm at will result in the application still functioning.

The second issue is that Internet Explorer issues friendly errors so as not to alarm the end user, and if the content returned from a request is less than 512 bytes, Internet Explorer will show its own error message instead of the contents of App_Offline.htm.  You could just stuff App_Offline.htm with hidden content in a comment block, but a better choice would be to provide a descriptive page, along with helpful information such as alternate sources for the user, an estimate of when the application will be available or even contact information for users who continue to receive the message.

Visual Studio (all versions) uses the App_Offline.htm file while publishing the application to a web server.  This means that if you have a problem publishing the application and your application stops functioning, there may be an orphaned App_Offline.htm file in your application folder.

Blog Posts

App_Offline.htm and working around the "IE Friendly Errors" feature - Scott Guthrie
ASP.NET 2.0 Features: app_offline.htm - ASP.NET 2.0 Resources -


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

ASP.NET Community
United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.
Group type: Collaborative Group

764 members

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170924.2 | Last Updated 11 Oct 2013
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid