February 21 2014

How to enable details error information in IIS and ASP.NET

Tagged Under :

asp.net
By default, IIS and ASP.NET hide detailed error information to prevent revealing sensitive information about your web application.
Sometimes we need to see error details (think shared hosting) to debug our coding.

To display the error message. Add these entries to your web.config file to disable generic errors:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <customErrors mode="Off"/>
  </system.web>
  
  <system.webServer>
    <httpErrors errorMode="Detailed" />
  </system.webServer>
</configuration>
Now you can try refresh the page and you will be able to see the error message like below:

Make a Comment

You must be logged in to post a comment.