Local debugging in SharePoint

Sometimes you don’t want to use the ULS because you are working locally and you want to work quickly without having to add debugging code to your web parts/pages.

Sometimes it isn’t your code that is breaking and you still want to work locally.

Here is how:

  • Open up IIS and browse to your local SharePoint installation (Usually SharePoint – 80)
  • Right click it and click explore.
  • Locate the web.config and edit in your favorite editor
  • Locate the following three parts and change false to true and On to Off where appropriate:
    1. CallStack=”false” > CallStack=”true”
    2. debug=”false” > debug=”true”
    3. customErrors mode=”On” > customErrors mode=”Off”
    4. AllowPageLevelTrace=”false” > AllowPageLevelTrace=”true” (this will show headers cookies etc BIG HELP)
  • Once this is done go back to IIS right click the _layouts folder and locate the second web.config in there
  • In this file there is only a debug=”false” line change this to debug=”true”

Then you have two options for a page trace:

Either add it per page:

Or add it in the system.web node of your web.config for the entire site
<trace pageOutput=”true” enabled=”true” />

You have now enabled full debugging on SharePoint for your local installation.