Tuesday, January 3, 2012

Turn off custom errors for SharePoint2010 sites

Open the web.config ("C:\inetpub\wwwroot\wss\VirtualDirectories\<port>") and set:
By default, SharePoint2010 custom error page is turned on. So whenever you got an exception on a SharePoint page, it displays the custom error page with a correlation ID. You have to search the log file for detailed exception message. To turn off the custom error page, you need to do the following:
Open the web.config file for the specific web application and make the following modifications. (I suggest you to make a backup copy of the file before you start modifying the web.config file)
  1. Change CallStack="false" to CallStack="true" (in safemode element)
  2. Change debug="false" to debug="true"
  3. Change <customErrors mode="On" /> to <customErrors mode="Off" />

Server Error in '/' Application.

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
Details: To enable the details of this specific error message to be viewable on the local server machine, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".
As a refresher to anyone else that is running into this problem, there is another web.config in the _layouts directory (“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14”) where you need to turn the customErrors to be “Off”:

Shahzad Afzal

No comments:

Popular Posts