5

Is it possible in ASP.NET MVC to display a downtime page when publishing a project out to a server? Right now, if I hit the page while I am publishing I get an error:

Could not load type "App.MvcApplication"

It would be awesome if we could setup a downtime page so that users know to come back at a later time, instead of thinking that the app is busted.

stevebot
  • 23,275
  • 29
  • 119
  • 181

2 Answers2

6

You could add an app_offline.htm page to your application root, traffic will be redirected to that page until you remove or rename it.

More info

Community
  • 1
  • 1
bevacqua
  • 47,502
  • 56
  • 171
  • 285
  • Is it possible to redirect the application automatically (without renaming or removing app_offline.htm) after deployment progress is completed? Beacuse I need to forward the request to app_offline.htm only during publish progress. Any idea? – Jack May 20 '16 at 08:53
1

An alternative to doing this in the application is to have IIS sort this out for you.

Application Initialization Module gives this feature, and also allows you to run warm-up scripts.

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76