When an error occurs within SharePoint, the application by default will not display a detailed error message to the end user (this is done for security reasons). When you’re actively configuring/developing your SharePoint platform, it is sometimes useful to display detailed error messages.

Here are the steps to do it:

You must edit several “web.config” files:

1. Each SharePoint web application you created will have its own “web.config”. You can find these in the respective folders under “C:\inetpub\wwwroot\wss\VirtualDirectories”.

In the XML section <system.web> you have two changes to make:

CHANGE #1: <customErrors mode=”Off” />

( This is normally set to “On” so change it to “Off”)

CHANGE #2: <compilation batch=”false” debug=”true”>

(The ‘debug’ attribute is normally set to “false” so change it to “true”)

In the XML section <SharePoint> you have a single change to make:
CHANGE #3: <SafeMode MaxControls=”200″ CallStack=”true”…>

(The ‘CallStack’ attribute is normally set to “false” so change it to “true”)

Remember, you must make these THREE changes in EACH of the web.config files found in the folder for each of your web applications!

2. You must also change the “web.config” that is global to SharePoint (ie: applies to all web applications). This file is located here:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config

In the XML section <system.web> you have a single change to make:
CHANGE #1: <customErrors mode=”Off” />

(This is normally set to “On” so change it to “Off”)

*** Thanks go to David Biersach for providing detailed background information for this post. ***