posted on Saturday, August 27, 2005 6:32 AM by Saravana

ASP.NET 2.0 – Methods to take your application offline

In ASP.NET 2.0, you have multiple options to take your application offline.

  1. By setting httpruntime to false in web.config. For example,
       
  2. Using ASP.NET Configuration Site. In this configuration site, you have option to take your application offline in “Application Configuration” tab. This tab also shows whether your application is currently offline or online. Internally this configuration uses the first option to shutdown the application i.e by setting httpruntime to false. To know more about ASP.NET Configuration.  Check out this article.
  3. Third option is by creating an empty htm page named app_offline.htm in your root directory. If this htm page contains any content, then that content is displayed instead of 404 error.

Advantages of all these options are, it doesn’t shutdown the whole process in which your web application is running. It just shuts down the appdomain of your web application. Hence other applications which runs along with your application in the process runs without any problem. These options can be used when you are doing maintenance on your site.

Note: If you web application gives 404 error, then check whether any one of this options is enabled. Actually, copy web site in ASP.NET 2.0 internally uses app_offline approach and sometime it leaves that file in the root directory. When you access your site after copy web site operation, you might get offline message. Then check out for this dummy page and remove it.

Comments