App_Offline.htm

If you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shuts-down the current web application, unloads the web application from the domain server, and stops processing any new incoming requests for that application.

ASP.NET will also then responds to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file.

For example: you might want to have a “Site is under construction” or “the current website is down for maintenance” or “Uploading Changes” message.

This is one of the convenient & easy way to take down your application while you are making big changes or copying lots of new page functionality (at the same time you can 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 2005 database whose .mdf data files are residing in the /app_data directory. This will be applicable for the Access (*.mdb) files too!

Once you have removed the app_offline.htm file from the root, the very next request into the web application will cause ASP.NET to load the application and application domain again, and life will continue along as normal.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: