Bringing down an ASP.NET Application for updates
One of the really useful, and not well-known features of ASP.NET 2.0 is that you can use a special file to take your application down and show users a friendly message while you update the site.
This is talked about by ScottGu here.
What this will allow you to do is to make changes to this application while the rest of the site is functioning normally. Users that try to use this application will get an error message that you put into the file.
So how do you accomplish this? It is simple. Just place a file called "app_offline.htm" in the root of your application. The html of this file is what will get displayed to any users that attempt to browse to the site. When you are done making changes, simply delete this file and the site will start back up normally.
This is a great solution if your application is being hosted by an ISP. Because it is always better to update an application while it is stopped and this is a way for you to stop your application cleanly and update it without affecting any other applications running.
Scott's post talks about a size issue with IE6 that you should keep in mind if you use this file, you want to make sure the file is larger then 512 bytes.
There are some other best practices for production ASP.NET applications talked about here.
Comments
Anonymous
March 11, 2008
You've been kicked (a good thing) - Trackback from DotNetKicks.comAnonymous
March 11, 2008
While this is great and very useful, what would be even more useful is to have an In Testing page that you can allow testers into but no one else. Again - this alone is great.Anonymous
March 12, 2008
The comment has been removedAnonymous
March 12, 2008
I've used a "In Testing" type flag on production boxes to allow us to do a quick shakedown after a deploy to ensure a deploy has gone smoothly without allowing non-test users to access the system, so any rollout issues dont reflect badly on the system to its users.Anonymous
March 12, 2008
ASP.NET Debugging : Bringing down an ASP.NET Application for updates "One of the really useful,