Disable ASP.NET "Friendly" Error Messages

Article Contents:

 

Overview

 

By default, SharePoint sets ASP.NET to display "friendly" error messages to the end user.  For example, a "friendly" error message in SharePoint might look like this:

 

SharePoint friendly error message

 

 

Sometimes for troubleshooting, it is necessary to disable this default behavior and allow ASP.NET to display a "full stack trace", such as this:

 

ASP.NET full stack trace

 

 

To override the default behavior and see a full stack trace, you must edit the settings of the web.config files in these two locations on each web front-end server in your SharePoint farm:

 

Follow the steps below to disable friendly error messages in these files.

 

The edits below will need to be made on each web front-end server in your SharePoint farm.

 

Disable SharePoint's friendly error messages

  1. Open IIS Manager by typing INETMGR at a command prompt
  2. Go to your extranet site in IIS Manager, right-click select Explore
  3. Make a backup copy of your web.config file
  4. Using Notepad or another text editor, open the web.config file
  5. In the SafeMode tag, set the CallStack attribute to 'true' (note: this is case sensitive)
  6. In the customErrors tag, set the mode attribute to 'Off' (note: this is case sensitive)
  7. Refresh the SharePoint page containing the error, view the error message along with the error stack trace.

 

Turn Off Extanet Site Friendly Error Messages in web.config file
<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
...
<customErrors mode="Off" />

 

 

Disable custom ExCM pages friendly error messages

  1. Open a file explorer and browse to the 'C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15TEMPLETELAYOUTS' directory  (note: for SharePoint 2016 replace "15" with "16" in this path)
  2. Make a backup copy of your web.config file
  3. Using Notepad or another text editor, open the web.config file
  4. In the customErrors tag, set the mode attribute to 'Off' (note: this is case sensitive)
  5. Refresh the Layouts page containing the error, view the error message along with the error stack trace.
Turn Off Layouts Friendly Error Messages
<customErrors mode="Off" />
 

 

©2019 PremierPoint Solutions. All Rights Reserved. 

Create your own Knowledge Base