Thursday, November 16, 2006

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.

0 comments: