What's happening in your situation is you have .NET configured to handled 404 errors. However, when a user requests a resource from your web server, IIS initially recieves the request. It makes a decision on who should handle the request. For static content (ie a directory listing such as /blah or a static page, /blah.html) it handles the request internally; meaning ASP.NET is never called. In that situation, if IIS needs to return a status code 404, it'll first check the Custom Errors section for the Virtual Directory or Site, and it will return what ever is listed in that section. However, in this case ASP.NET is never initialized; the request is never forwarded to the ASP.NET worker proces (aspnet_wp.exe) so you're web.config is never loaded, and ASP.NET doesn't return the error page specified in your web.config.
When IIS receives a request for an ASP.NET resource, ie an aspx page, the request is forwarded to the ASP.NET worker process (aspnet_wp.exe), which spawns an instance of the .NET CLR and begins processing the request. In the event that the resource doesn't exist, then ASP.NET checks the web.config to see if the customErrors tag is defined, and returns accordingly.
Thus, when you publish your site, it is imperitive that you configure BOTH asp.net and IIS CustomErrors.
PJ
Main Topics
Browse All Topics





by: ppittlePosted on 2009-04-13 at 11:01:47ID: 24131549
fprickett,
You need to configure IIS Custom Errors for the Site/Virtual Directory. See the attached screen shot.
Screen Shot of IIS Manager