When you publish a .Net application - what's the easiest way to put something up for users that says 'this application is currently being upgraded, please try later'
views:
36answers:
1
+4
A:
If you create a file in the folder called app_offline.htm, your application will serve that to users instead of the application. ScottGu has a great blog post on it here.
I tend to add one of these to every project but call it app_online.htm, then when I need to make changes I can just rename the file instead of having to create one from scratch.
PhilPursglove
2010-09-20 10:06:45
How (very interesting)? Where is this documented?
Patrick
2010-09-20 10:08:17
@Patrick Strangely I can't find any particular MSDN page that describes this behaviour, though it's been around for a good long while now. It's mentioned in a walkthrough at http://msdn.microsoft.com/en-us/library/f735abw9(VS.85).aspx.
PhilPursglove
2010-09-20 10:11:45
@PhilPursglove: I did not know that one, pretty nifty. (Does this work on Mono as well?)
Patrick
2010-09-20 10:34:57
@Patrick I thought *everyone* knew about it, I was a bit surprised to see this question! Mono: don't know for certain but the comments in this question http://stackoverflow.com/questions/2626764/how-to-refresh-mono-asp-net-page-without-restarting-the-web-server suggest it doesn't work for Mono...
PhilPursglove
2010-09-20 10:42:59
@PhilPursglove: I guess I'm in the ~everyone group in that case. Thanks for the Mono find as well. :-)
Patrick
2010-09-20 10:55:25
Thanks for that. I knew (think) that file gets created automatically when you publish - and is then removed. Couldn't remember what it was called though.
Mike Wilson
2010-09-20 11:07:53
@Patrick No offence intended, this feature's been in the product since ASP.NET 2.0 and I have a tendency to assume that everyone's been doing ASP.NET as long as me and seen all these features get added...
PhilPursglove
2010-09-20 11:16:30
@Mike I didn't know the Publish feature creates it for you while it's working :-)
PhilPursglove
2010-09-20 11:20:11
@PhilPursglove: None taken
Patrick
2010-09-20 11:58:37