SharePoint under the hood - see real error description and callstack/stack trace
I have always loved the nice SharePoint error messages that are presented when something goes wrong. My most popular error message is "An unknown error occured. Please contact your system administrator.".
In order to see the real error messages as well as the stack trace of where the error happened within SharePoint, you have to do two simple things - in fact, this is mainly standard ASP.NET business:
In the web.config file of your SharePoint web application, edit these two entries:
1. Switch custom errors off
<system.web>
...
<customErrors mode="On" />
...
</system.web>
Set the value "On" to "Off" in a development or staging environment, or to "RemoteOnly" if you have to troubleshoot an issue in a productive environment (of course, the error has to be reproduced locally in this case).
2. Enable CallStack
<SharePoint>
...
<SafeMode MaxControls="50" CallStack="false" />
...
</SharePoint>
To make the CallStack visible, set the value to "true".
Please note that changing the web.config will cause SharePoint to restart the whole web application immediately after saving.
1: <configuration>
2: <SharePoint>
3: <SafeMode CallStack="true" />
4: </SharePoint>
5: <system.web>
6: <customErrors mode="Off" />
7: <compilation debug="true" />
8: </system.web>
9: </configuration>
'Solution Platform' 카테고리의 다른 글
Configuring Forms Authentication in SharePoint 2007 (0) | 2009.03.31 |
---|---|
Another simple code snippet - using the user field (0) | 2009.03.31 |
Complete reference of all STSADM operations (with parameters) in MOSS 2007 (0) | 2009.03.31 |
Silverlight & MOSS Web.Config Settings (0) | 2009.03.30 |
Hosting a WCF service in Windows Sharepoint Services v3.0 (1) | 2009.03.30 |