Wednesday, July 18, 2012

Turning off custom errors in for debugging in SharePoint 2010



As a developer, one of the first things I do after I have setup a web application & site collection is:
Open the web.config (“C:\inetpub\wwwroot\wss\VirtualDirectories\(port)”) and set:

1.change batch and debug to true - (compilation batch="true" debug="true" )
2.change CallStack=”true” in safe Mode tag - (SafeMode CallStack="true")
3.Change CustomErrors=”Off”
However when I ran into exception, instead of getting the detailed message I was expecting, I ended up getting the infamous message telling me to change the customerrors setting in the web.config so that I can see the details:

Server Error in '/' Application.

After embarassingly long time I figured out there is another web.config in _layouts directory - C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14

Custom errors need to be turned off here too.