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.

kick it on

Comments (6)

  1. You’ve been kicked (a good thing) – Trackback from

  2. Phil Lertora says:

    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.

  3. That is a good idea.  But would you really want to have a testing "stage" on your production web server?  Wouldn’t that be more of the things you would do before you publish to the server?

    Is there a scenario where this would be needed in that case?  Or are you talking about if you only have one server and test and release on the same box?

  4. Jenni says:

    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.

  5. ASP.NET Debugging : Bringing down an ASP.NET Application for updates "One of the really useful,

Skip to main content