7/31/2010
LifeCycle Solutions - Home ( the software development blog )
 

<November 2006>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Subscribe to this feed:

RSS 2.0 | Atom 1.0 |CDF






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