août 31

Let's imagine you have a standard application deployed in IIS (here, the "MyApp" application). Simply browsing the application will show you the default page content, and you can also access any page of the website.

Now let's imagine you want - for maintenance reasons for example - bring this application offline.
If you stop IIS or your application pool, all your customers will receive an HTTP error, typically a 500 error. Let's imagine you want to have real "maintenance page" whatever the request they will do.
Of course you can change the "default" document in IIS, but if they ask for a specific page, this won't work.

IIS has this feature fully integrated. Simply add a page named "app_offline.htm" in the virtual directory and let's try now several requests, asking either for the virtual directory itself or for any page in the application.

This is pretty cool no ?
Just note that this will work if the client ask for aspx pages. Any other format will be served normally.
Scott Guthrie has also noted that you maintenance page should have a minimal weight otherwise, you would encounter some trouble. Check his blog entry here.


Working another way for maintenance sessions ? Please leave comments !   

Tags: |

Commentaires

Bar Loïc

Posted on vendredi, 31 août 2007 14:25

Very nice! Smile

Francois Wullens

Posted on jeudi, 6 septembre 2007 03:40

When you running a web application in debug mode,it can  arrive that Visual Studio add (after some problem, I believe) automatically the page "app_offline.htm" in your web project.

So, your web application is offline and you ask you: "Why it don't work @#!?".

You must simply exclude or remove this page of your project to find a normal state.



Pierre-Emmanuel Dautreppe

Posted on jeudi, 6 septembre 2007 10:11

He he yes indeed François !
In fact Visual Studio use this system itself at least for publishing on IIS. And maybe also for some other features I don't know. So yes it may happen to have this page remaining from time to time

Ajouter un commentaire




biuquote
  • Commentaire
  • Aperçu immédiat
Loading