Udostępnij za pośrednictwem


Razor Migration Notes 3: Use app_offline.htm to deploy the new version

This is the third post on the series:

1: Moving a SitemapPath Control to ASP.NET Web Pages 2: Use URL Rewrite to maintain your Page rankings (SEO)

 

ASP.NET has a nice feature to help for deployment processes where you can drop an HTML file named app_offline.htm and it will unload all assemblies and code that it has loaded letting you easily delete binaries and deploy the new version while still serving back to customers the friendly message that you provide telling them that your site is under maintenance.

One caveat though, is that Internet Explorer users might still see the “friendly” error that they display and not your nice message. This happens because of a page size validation that IE performs. See Scott’s blog on how to workaround that problem: App_Offline.htm and working around the IE Friendly Errors

Note: The live site is now running in .NET 4.0 and all using Razor.

Comments

  • Anonymous
    October 01, 2011
    I have used app_offline.htm for years now for maintenance purposes. Thanks for posting this as I am amazed how many  devs still don't know about this feature.