Disable ASP.NET Custom Errors in Web.Config


To totally unlock this section you need to Log-in


Login

Many times during the processing of an ASP.NET application, you will get the following runtime error.

Disable ASP.NET Custom Errors in Web.Config

This is a generic error generated by ASP.NET When customErrors are set to ON. To resolve this issue, create a web.config file if one is not already present in your C:/Inetpub/wwwroot/yourdomain directory.

Disable ASP.NET Custom Errors in Web.Config

Once you’ve located/created web.config edit the lines containing the <customErrors> configuration element. If the <customerrors> element does not exist, add the <customerrors > element under the <system.web> element.

You can locate the <customerrors> element by using CTRL+F.

Change the <customErrors mode ="on"/> to <customErrors mode ="off"/>. Your end result should look similar to the following:

Disable ASP.NET Custom Errors in Web.Config

When saved, ASP.NET should restart itself. To test your application, enter the URL in the browser. Your final result should be a completely different (and detailed) ASP.NET error page, similar to the following:

Disable ASP.NET Custom Errors in Web.Config

Congratulations, now you have detailed errors of your pages!