How would you go about placing the site off-line if the database is down or the database adapter is missing / failed to load / etc.?
I am asking in the context of ASP.NET MVC 3 but this can apply for any ASP.NET site.
Let's say somewhere around App_Start you load an assembly for data access and this is missing and/or something else fails. In this case the site can't actually function.
I'm looking for a decent/elegant way to place the site in "Maintenance mode" just like App_Offline.htm works.
catch (ReallyBadException ex) {
Utilities.EmailAdministrator();
File.Copy(@"c:\templates\App_Offline.htm", @"c:\path\to\website\App_Offline.htm");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With