Displaying Debugging Info for SharePoint Errors in Your Browser

Comments 0

Share to social media

SharePoint does a good job of hiding errors from users.  Out of the box, unhandled errors in SharePoint result in a fairly non-descript page that says “An Error Occurred” (or something to that effect).  Although a good practice for your end-users, it’s pretty annoying when you’re trying to get a piece of code working or a configuration setting correct.  Here’s how you can display debugging information in your browser:

  • Find the following line in your web.config:

    <SafeMode MaxControls=”200″ CallStack=”false” DirectFileDependencies=”10″ TotalFileDependencies=”50″ AllowPageLevelTrace=”false”>

  • Change the CallStack attribute to true
  • Change the AllowPageLevelTrace to true
  • Find the following line in your web.config:

    <customErrors mode=”On” />

  • Change the mode to “Off”

The next time you have an error, it displays the familiar ASP.NET error information page with exception details and the callstack information.  Much less frustrating than a blasé error message.

Load comments

About the author

Damon Armstrong

See Profile

Damon Armstrong is a consultant with SystemwarePS in Dallas, Texas. He is also a blogger and author of Pro ASP.NET 2.0 Website Programming and SharePoint 2013 Essentials for Developers. He specializes in the Microsoft stack with a focus on web technologies like MVC, ASP.NET, JavaScript, and SharePoint. When not staying up all night coding, he can be found watching a bunch of kids, studying Biblical topics, playing golf, or recovering from staying up all night coding.