in

ASP.NET Weblogs

Phil Scott's WebLog

Quite exciting this computer magic

The Curious Incident of the App_Offline.htm in your ASP.NET 2.0 App

I've gotten more than three issues sent to me recently regarding why an ASP.NET 2.0 app suddenly starts throwing up 404 errors, and each time there is a single culprit: app_offline.htm.  I'd point towards some documentation, but honestly I just can't find any out there, so hopefully this will help people figure out what is going on.  When ASP.NET 2.0 sees this file, it basically shuts down the process.  This is useful if you need to over write a MDB file for example.  

Strangely, each time I've encountered "issues" with 404 errors being thrown by applications when the file exists, this file exists and the customer doesn't know how it got there.  I'm not sure if they were just going through some demos and missed a step or something, or perhaps something in VS2005 or Web Dev Express is creating the file automatically.  Perhaps one of the publishing tools sends the file up, and fails to clean it up.  So there you go.  Hopefully this helps someone out there figure out why they are suddenly getting 404 errors on pages that exists, or maybe it helps people manage deployments easier by using app_offline.htm for what it was designed for.

Comments

 

Imar Spaanjaars said:

Yeah, VWD creates that file when you use the Copy Project option. See the comments on my FAQ item and see Chris's blog as well for more details http://p2p.wrox.com/blogs_comments.asp?BLOG_ID=108

Cheers,

Imar
August 3, 2005 2:28 AM
 

Hisham said:

This is very bizarre, and very VERY annoying, because every few days (wihtout touching the app), all of a sudden I start getting complaints that the website is down, then I see this file that appears out of nowhere and shuts it down!!! What a typical Microsoft feature!!

These guys always have good ideas, and just TERRIBLE execution.

I've been an ASP.NET developer since the very first Beta versions of .net, and back then I remember thinking "This is just aweful! The documentation is incomplete, alot of features work in a very counter-intuitive way, and they don't stick to their own coding standards!", then 2.0 came out and they pulled their act together in this one a little bit, but you can still see the typical Microsoft idiocy in their design. I guess we just gotta wait until .NET 4.0 (that seems to be the magic number for MS) when things are a little more stable.

Another example of terrible design, is when I installed web developer Express 2005, then my company bought the full license and decided to install it on my machine without removing VWD2005, now, everytime I attempt to install Ajax, it gets installed to VWD2005 with all the icons and fixins, but it completely ignores Visual Studio 2005, and when I tried to uninstall VWD2005, it crashed and failed halfway through, and now I can't remove it from my machine, and the only solution is to format.

June 26, 2007 11:30 AM
 

Fraser Lamont said:

When i place an app_offline.htm file its great i can update the site, though if i hit refresh in an already open ie/firefox window then i see the usual 404 page - how can i force any refreshes to load the app_offline.htm page?

I'm running iis7 on vista ultimate (nice btw, very nice) so is there a bug with this on iis7 or do i need to add in some sort of directive in the web.config file to help iis redirect?  Building the site with vs2k8 b3 (nice, buggy but nice), not sure if all this works normally in vs2k5.

cheers for any help.

August 15, 2007 4:35 PM
 

Putting ASP.net Application In Offline Mode Using app_offline.htm « Yanesh Tyagi writes … said:

Pingback from  Putting ASP.net Application In Offline Mode Using app_offline.htm « Yanesh Tyagi writes …

September 6, 2008 1:06 PM

Leave a Comment

(required)  
(optional)
(required)  
Add