Musings by Generator

Development, Life and everything else in S.A.

Debugging the “Unexpected error occurred” message in SharePoint

Every SharePoint developer has gotten this error message before: “Unexpected error occurred” or something close to that, and has spent hours scratching their heads!

 

I found a little bit of information that has just made my debugging life easier so I thought I better share it. To get more debug information, make the following changes in your web.config file for your SharePoint site, and instead of this generic error, you will get an asp.net error page with stack trace data.

Find:

<SafeMode MaxControls=“200“ CallStack=“false“... />

 

and replace it with:

<SafeMode MaxControls=“200“ CallStack=“true“…/>

 

Also, you will need to set CustomErrors off:

<customErrors mode=“Off“/>

 

The above two changes will give you that wonderful asp.net stack trace error page, allowing you to actually debug your application.

« Newer Posts