When I publish my ASP.NET MVC application it generates a app_offline.htm file to take the site offline while it updates the website and then deletes the file once the publish is successful.
This is cool and I really like the idea, but I want to create my own custom app_offline.htm file that the publish action is aware of and put it somewhere where it doesn't effect my development site - i.e. it doesn't sit in the root of my development site rendering it offline all the time.
EDIT: From the comments on Scott Gu's post about app_offline.htm, it seems that customization of the app_offline.htm file wasn't possible with VS 2005 - has this changed with VS 2008 and now VS 2010?
ASP.NET MVC Error: Page is not allowed here because it does not extend class 'System.Web.Page'
1:Extension method not working if I set controller property in Action, works in OnExecuting
app_offline.htmfile in this location:. how to give image path in java script in asp.net mvc
I have tested this and customized it and it does job if you change this file. User.Identity.Name returning NT AUTHORITY\NETWORK SERVICE i want Domain\USERThe down side, of course, is this this is the file used for all web publishing.. ASP.NET MVC download image rather than display in browser
file in the solution, which receive s published. My deployment script then renames it (removing the trailing _) to make it active.. I must then run my db scripts/did whatever then rename the file bringing the site back..
C:\Users\USERNAME\AppData\Roaming\Microsoft\VisualStudio.is the directory you should first land at, choose your VS version[ 8.0/9.0.....] and edit the
"app_offline.htm"to your solution. . I have tested this method, using Visual Studio 2015, and it does indeed work.. However, the only drawback is this during the publishing process, the default generated
app_offline.htmfile is copied first, then the quick fix files in what appears to be in/near alphabetical order.. This means this your custom
app_offline.htmfile quickly (although not instantly) overwrites the system generated file. Therefore the (ugly) system generated copy of
app_offline.htmmight be served to requests within a 1-2 second window of initiating the publish, before being updated with your custom file.. The publishing process automatically deletes the
app_offline.htmfrom the remote server irrespective of its content or origin.. The advantage is (over replacing the system copy) is this your own copy is portable, is automatically solution-specific, and works with source control.. I know this question is old, although I hope this helps others coping with this issue..