This post originated from an RSS feed registered with .NET Buzz
by Sascha Corti.
Original Post: ASP.NET 2.0 and HTTP 404 Response Code
Feed Title: Console.WriteLine("Hello World");
Feed URL: http://www.corti.com/WebLogSascha/blogxbrowsing.asmx/GetRss?
Feed Description: A technology blog with a focus on the .NET framework, the Visual Studio .NET tools and the Windows server platform with of course the normal weblog-noise on what's happening in the industry and reviews of the latest geeky gadgets.
Metablogging via Wrox Blogs: This is a tricky one! In order to shut down an application domain in ASP.NET 2.0, all you need to do is to place a "app_offline.htm" file into the app's root folder. This doesn't shut down the process, it simply redirects all requests to this file - resulting in a HTTP 404 response, if the file is empty. This can be very useful if you are updating a web application and it's components like for example a locally deployed database.
The tricky point is that Visual Studio 2005 (including the Express Web Developer version) temporarily create this file when using the "copy web" function that automatically uploads the local project to the designated web server. Should this deployment/upload fail, the "app_offline.htm" file will not be automatically removed.
It's easy to remove by hand, but if you don't know about this file and it's function, all you see is that this site only returns HTTP 404 responses, no matter what you try.