Saturday, August 8, 2009

How to display detailed error messages into SharePoint page

It happens most of time with everyone when they are working with SharePoint and gets error message is “An unexpected error occurred”, that’s very boring and frustrated error message into SharePoint page, which leaves a number of guesses and questions. 

If you would like to know what exact error description is, then we need to make following changes into our SharePoint web application web.config file. 

1> CallStack=”false” changed to CallStack=”true” 

2> <customErrors mode=”On” /> changed to <customErrors mode=”Off” /> 

Happy debugging :)


  1. Hey Disha,

    Just now you saved my lots of debugging time, I was getting error "file not found" into my custom ASPX page, after making web.config file changes as describes into your post, I got descriptive error messages related to which file I was missing into my SharePoint custom ASPX page. Finally I have solved my problem.

    Thanks a lot for the useful information.


  2. Hey Sanket,

    Thanks for comment.

  3. Hi Disha thanks for this post, I have been getting a number of errors since migrating to a new environment, which I was able to resolve once it was more obvious what the underlying issue was. It ended up being a combination of a number of missing Web Part assembles which I first suspected. In my case, displaying errors was all that was required as the message displayed contained the specific details of the missing assemblies.

    I also found the following article which explains how to enable errors, call stack trace, debugging and the ASP.NET tracing feature which may also help when troubleshooting SharePoint errors.

    ( )