How to: turn off custom errors for debugging mode in SharePoint 2010 application pages

Unfortunately custom errors is a setting that lives at the SharePoint site level, not at the ‘application page / _layouts’ level, so you will have to edit the web.config that applies to the entire SharePoint site which is located at: C:inetpubwwwrootwssVirtualDirectories

Once there you’ll have to enable 3 different settings that should already be there for it to work:

  1. CustomErrors = ”Off” instead of the default which is ‘On’
  2. Debug=”true”. I keep hearing this might be set to false but in my case it shows true
  3. CallStack=”true”. Again, another value that is there for me by default but might not be in your setup.

Now remember that before making any chances you want to back up your web.config. It is a very long and delicate file and if you mess something up by accident rolling back your chances might be very hard.

In my case all I had to do is is go to the _layouts web.config and change the following line:

<customErrors mode=”RemoteOnly” />

 

Server Error in ‘/’ Application.
——————————————————————————–
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
Details: To enable the details of this specific error message to be viewable on the local server machine, please create a tag within a “web.config” configuration file located in the root directory of the current web application. This tag should then have its “mode” attribute set to “RemoteOnly”. To enable the details to be viewable on remote machines, please set “mode” to “Off”.
<!– Web.Config Configuration File –>
<configuration>
<system.web>
<customErrors mode=”RemoteOnly”/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the “defaultRedirect” attribute of the application’s configuration tag to point to a custom error page URL.
<!– Web.Config Configuration File –>
<configuration>
<system.web>
<customErrors mode=”On” defaultRedirect=”mycustompage.htm”/>
</system.web>
</configuration>

 

 

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.