Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way I can still use app_offline.htm on my ASP.NET MVC 2 projects? If not, is there an alternative method?

I loved the features of using app_offline.htm on my ASP.NET WebForm based sites.
Upload the file and your app is immediately "offline". Snappy.

Now that I'm using MVC 2, I noticed that this no longer works.
Is there a way to get this behavior in ASP.NET MVC 2 like it did in WebForms?
If not, what alternative do you prefer?

like image 284
CitizenBane Avatar asked Apr 21 '10 19:04

CitizenBane


People also ask

Where to place App_ offline htm?

The way app_offline. htm works is that you place this file in the root of the application.

How does App_offline HTM work?

The App Offline file ( app_offline. htm ) is used by the ASP.NET Core Module to shut down an app. If a file with the name app_offline. htm is detected in the root directory of an app, the ASP.NET Core Module attempts to gracefully shut down the app and stop processing incoming requests.


1 Answers

app_offline.htm works on MVC sites. You need to make sure it's 512 bytes or larger. I use it all the time when updating a couple of MVC sites.

like image 142
37Stars Avatar answered Sep 22 '22 20:09

37Stars