I have an ASP.NET MVC 2 application, which has an Application_Error event handler in global.asax. In this, I\'m detecting the case where the Exception type is HttpException
The Answer by Flynn solved my issue of ASP.NET taking control of the 404
Now I am able to do this:
Response.TrySkipIisCustomErrors = true; Response.StatusCode = 404; Response.Write(""); HttpContext.Current.ApplicationInstance.CompleteRequest();