Monday 2 April 2012

How to get detailed error description in SharePoint


By default SharePoint will display basic message to users this is useless when we are doing any trouble shooting to display complete error description and stack trace of the error you need to modify the web.config for the WebApplication.

We can achieve this by following below steps.

1)     Disable Custom Errors: Set the customErrors mode to "Off"

Find:

<system.web>
<customErrors mode="On" />

Change To:

<system.web>
<customErrors mode="Off" />


2)    Enable the Call Stack Trace: Set the CallStack value of the SafeMode element to "true"

Find:

<SharePoint>

<SafeMode ... CallStack="false" ... >

</SharePoint>


Change To:

<SharePoint>

<SafeMode ... CallStack="true" ... >

</SharePoint>


3)    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"/>