OK, this is nothing new, but like Eric White, I want to make sure I can always find these settings. Plus I hope this can be helpful to others looking for them.
- <SafeMode CallStack=”true” (search for “calls”)
- <customErrors mode=”Off” (search for “custome”)
- <compilation debug=”true” (search for “debug=”)
If you are writing custom components in SharePoint, or you are a system administrator you may see the following:
An unexpected error has occurred.
Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: (some correlation ID in the format 12345678-90ab-cdef-1234-567890abcdef made up of hexadecimal characters).
At this point, you can search the ULS for the corelation ID (my favorite tool for that is the ULS Viewer) or you can edit the web.config so you can see the error displayed by ASP.NET.
The easiest way to edit the web.config is to launch InetMgr.exe (Internet Information Services (IIS) Manager), find the IIS site that matches the SharePoint Web Application zone you need to debug, right-click, and choose Explore.
Once you are in the Windows Explorer folder for the root of the Web App you need to modify (it will probably be something like C:\inetpub\wwwroot\wss\VirtualDirectories\<webappname>), then look for web.config. If you are not experienced at editing XML, I recommend you make a backup of the original, in case you mess it up and can’t fix it, that way you can roll back to the original.
Now open web.config with Notepad (or favorite text editor, mine is Notepad++)
Search for “calls” that will locate CallStack=”false”. If for some reason your web.config has multiple matches for calls then search for “callstack”. Change false to true. Search for custome (there are many matches for custom, but only one customerrors, so custome usually does it. Change On to Off (remember XML is case sensitive, so honor the casing of the previous value). Finally, search for debug= (you need the equals sign because there are many reference to the word debug in web.config. Change false to true. Now save it.
Refresh the browser window that displayed the original error and you should see something like this:
With this debug information, you will be on your way to finding out where the exception occurred and closer to fixing it. Happy debugging!
For more information:
- Here is the MSDN Post: Debugging SharePoint Solutions
- Here is Eric Whites’ Post: Modifications to web.config for Debugging SharePoint Components