8/28/2008
LifeCycle Solutions - Home ( the software development blog )
 

<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Subscribe to this feed:

RSS 2.0 | Atom 1.0 |CDF





Add to Technorati Favorites

Thursday, November 30, 2006

Here's one feature of ASP.NET 2.0 you may not have heard of- I certainly hadn't until it hit the blogs again recently.  If you drop a file named app_offline.htm in your web application's root folder, then all requests to that application will only return that file.  

Very handy for scheduled downtime, bringing down your app for updates, etc.  Scott Guthrie mentions the trick here, as well as a minor issue to be aware of when designing your app_offline page.

One novel way to implement this is to integrate it into your deployment process.  For example, a simple batch file like this:

copy C:\MyCompany\app_offline_updating.htm C:\InetPub\wwwroot\Demo\ProjectName\app_offline.htm /y

xcopy C:\MyCompany\ProjectName*.* C:\InetPub\wwwroot\Clients\Demo\ProjectName\ /s /q /y

del C:\InetPub\wwwroot\Clients\Demo\ProjectName\app_offline.htm

The batch file can be run manually, or even better- as part of your continuous integration process.  With a little javascript or meta-tag to do automatic refreshes, this is a great way to avoid errors and communicate downtime to users.

Posted by Daniel Root

© 2006 LifeCycle Solutions, LLC | All Rights Reserved