How to turn on Detailed Errors in ASP.NET directly in IIS (instead of Control Panel)

If you are building a sophisticated web application where you want to return a very specific and helpful error message back and have the browser display that message rather than standard HTTP error message, it is simple configuration magic.

Normally, detailed error message is OFF.  IIS will not even send the text to the client browser.

In earlier version of Control Panel, there used to be a checkbox to turn on detailed error messages.  In version 2.0, you only have the option of return custom pages back when errors happen.  This is not optimal in many cases.  You don’t want to throw the user on a completely new page.  For example if the user enters bad password, it is much better to show them a specific message right in line so that the user can correct things right there.

Turning on detailed error messages is easy 2 step process:

*  Start IIS Admin and select your website under Sites. You can find a guide on how to do this here:

* Click on “ASP” under IIS Admin section.  On ASP properties page, Click Debugging Properties to expand it.  Near the bottom you will see “Send Errors to Browser”.  Turn that to TRUE.

* Now file Error Pages under IIS section.  It will show you all the different HTTP errors.  For each or the specific ones you care about, you can select the entry.  Now look at the right hand side to find the “Edit Feature Settings” option and click it.  Property page comes up that gives you various option.  Select the “Detailed Errors” option (middle one).

That’s it.  Yes, it seems really hidden away.  not sure why this isn’t the default.  It seems so logical to have the browser show detailed message when your server side controller throws HTTP error and sends a specific error text.

but now you know how to turn this on.  We use this extensively to show in line errors and help users correct mistakes.  Much better user experience.

Posted under ASP .NET 4.0 | RSS 2.0

Leave a Reply

Your email address will not be published. Required fields are marked *