SharePoint Web.Config: How to Show Full Errors

Enable display of error details and stack trace when an error occurs

Replace the following error messages with a more meaningful description of the cause of the error by disabling custom errors and enabling the track trace to be displayed as well.

An unexpected error has occurred
An error occurred during the processing of…

To display full errors and the stack trace of the error, you need to modify the web.config file for the Web Application which SharePoint is running on. There are a number of web.config files required to configure various components of SharePoint. See notes below for more information about modifying the web.config file to display errors.

Enable Custom Errors: Set the customErrors mode to “Off”

<system.web> …<customErrors mode=”On” />
Change To:
<system.web> …

<customErrors mode=”Off” />

Enable the Call Stack Trace: Set the CallStack value of the SafeMode element to “true”


<SafeMode … CallStack=”false” … >


Change To:

<SafeMode … CallStack=”true” … >


Enable Debugging Mode: Set batch and debug to “true”

Find: <compilation batch=”false” debug=”false”>

Change To: <compilation batch=”true” debug=”true”>

Enable the ASP.NET tracing feature:

Include the following line in the <system.web> element of the web.config file.

<system.web> …

<trace enabled=”true” pageOutput=”true”/>

By default, SharePoint will only display a basic message to users when an error occurs. The message is virtually useless when trying to troubleshoot an issue, so by enabling more descriptive errors to display, including the stack trace which should help you find the cause of the error. You should not make changes to the web.config file in a production environment, or while in production. Back up your entire SharePoint environment, including all databases prior to commencing any major troubleshooting. You should attempt to replicate and resolve the problem in a non-production environment, and apply the necessary changes to the live environment when it is not in production. In many cases, the web.config will not need to be modified in the live environment as the cause of an error will be known after troubleshooting in a production environment.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: