There are two things that we can set on the ASP.NET side in the web.config that can help with this problem. First, the tradional customErrors
section of the web.config that goes in the <system.web>
section of the web.config:
<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
Next, in the <system.webServer>
section of the web.config there are two tags you should add:
I should note, for these I’m currently using the .Net Framework 4.0 on IIS7. There is one more thing you can try if the above doesn’t work. Here are the steps (I believe that setting this in IIS will open up detailed messages for everyone connecting to your site so this may not be desirable depending on your situation):
- Open the IIS7 Manager
- Select the web-site you want, then double click on
Error Pages
- Right click and select
Edit Feature Settings
- Select the
Detailed errors
radio button and clickOK
.