Home


.Net, SQL and softball. Musings of a software developer with a softball problem

Monday, June 16, 2008

Taking a .Net app offline

There are times when you need to take an application off line for a period of time for maintenance or you just don't want people on the site for back up or something. I dunno.

With .Net 2.0 there is a really easy way to do it, and there are no configuration settings you have to mess with in IIS or anywhere. You just have to drop a file named app_offline.htm into the root of your site and blammo your app will show whatever text is in that file. There is one little pitfall though. The file size has to be at least 512 bytes or sometimes the .Net compiler won't recognize the file. So you can just put some junk in there in HTML contents, or you can write a really nice long message to your users

And when you want to bring the app back up, just remove or rename the file. Pretty neat little trick...

Labels:

posted by Tom Becker at

0 Comments:

Post a Comment

<< Home

Powered by Blogger

Subscribe to
Posts [Atom]

Name: Tom Becker
Location: Richmond, VA, United States