Enable debugging in SharePoint Web.Config

How to Enable debugging in SharePoint Web Config file

In this post, we will explain how to enable debugging in SharePoint Web.Config file as well as we will list all SharePoint Web config files Physical Paths.


How to enable debugging in SharePoint Web.Config?

To enable debugging in SharePoint Web.Config, you should first do the following:

  • Set the compilation “debug” property to “TRUE“.
  • Set the “CallStack” property to “TRUE“.
  • Set the “Custmerrors” property to “Off“.
Enable debugging in SharePoint Web.Config

Steps

  • Locate your SharePoint web application config files in all WFE servers cross the farm that usually located at
"C:\Inetpub\wwwroot\wss\VirtualDirectories\PortNum"
  • You can also locate the directory of SharePoint Web Application using IIS as shown below.
Explore Web site in IIS Manager
  • Don’t forget to take a backup from the web.config before modifying it.
  • Run notepad or notepad ++ or any other editor as Administrator.
  • From the notepad, open the web.config file.
  • Search for the below entry.
<compilation debug="false">
set compilation debug false
  • Set the debug value to “True“.
<compilation debug="true">
  • Again, search for “CallStack
<SafeMode  CallStack="false">
Set CallStack true
  • Set the CallStack=”TRUE“.
<SafeMode  CallStack="true">
  • In the end, search for “customErrors”
<customErrors mode="On" />
set custom errors mode to off
  • Set the mode to “Off“.
<customErrors mode="Off" />
  • Save the file.

Don’t forget to apply the same steps on other WFE servers within the farm.


Enable Debugging for SharePoint Central Administration

In some cases, you may get a server error when opening the SharePoint Central Administration. In this case, you will need also to show the detail error message to can trace your issue.

For Central Administration, there are three different locations for web.config files that should be modified to be able to enable debugging in SharePoint Central Administration and shows the detail error messages:

  1. Central Administration Web Application folder.
  2. Layouts folder.
  3. Admin folder.

Please, don’t forget to take a backup from the web.config before modifying it.

Locate Central Administration Web Application folder

  • Open IIS > Right Click on your Central Administration Site > Select “Explore”.
Enable Debugging for SharePoint Central Administration
  • Run notepad or notepad ++ as Administrator.
  • From the notepad, open the Central Administration web.config file.
  • Search for “CallStack”
<SafeMode  CallStack="false">
Set CallStack true
  • Set the CallStack=”True“.
<SafeMode  CallStack="true">
  • Again, search for “customErrors”
<customErrors mode="On" />
set custom errors mode to off
  • Set the mode to “Off“.
<customErrors mode="On" />
  • Save the file.

Locate SharePoint Layout folder

  • Run notepad or notepad ++ as Administrator.
  • From the notepad, open the web.config file that located at
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts
  • Search for “customErrors”
<customErrors mode="On" />
  • Set the mode to “Off”.
<customErrors mode="On" />
  • Save the file.

Locate SharePoint Admin Folder

  • Run notepad or notepad ++ as Administrator.
  • From the notepad, open the web.config file that located at
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\ADMIN
  • Search for “customErrors”
<customErrors mode="On" />
  • Set the mode to “Off”.
<customErrors mode="On" />
  • Save the file.

You should apply the above changes to all Application SharePoint servers that host Central Administration within your farm.

Web.Config files Physical Path list In SharePoint

SharePoint Web Application Web.Config

The web.config file that defines configuration settings for a SharePoint content Web application.

\\Inetpub\wwwroot\wss\VirtualDirectories\Port_Number
SharePoint Web Application Config File

SharePoint Central Administration Web.Config

The web.config file that defines configuration settings for the SharePoint Central Administration application

\\Inetpub\wwwroot\wss\VirtualDirectories\ Port_Number_of_Central_Administration
SharePoint Central Administration Config File

Pages used in SharePoint Central Administration Web.Config

The web.config file that defines configuration settings for pages used in SharePoint Central Administration.

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\ADMIN
SharePoint Admin Config File

Extending other Web Applications Web.Config

The web.config file and other .config files that together define configuration settings for extending other Web applications

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\CONFIG
Extending other Web applications web config

/_vti_bin virtual directory Web.Config

The web.config file that defines configuration settings for the /_vti_bin virtual directory.

SharePoint Virtual Directory Config File
%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\ISAPI

/_layouts virtual directory Web.Config

The web.config file that defines configuration settings for the /_layouts virtual directory.

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS
SharePoint Layouts Web Config File

Please, note that the 14 hive for SharePoint 2010 and 15hive for SharePoint 2013 and SharePoint 2016.


Conclusion

In conclusion, we have explained how to enable debugging in SharePoint Web Application and Central Administration as well as we have explored the locations list for all configuration files inside the SharePoint.

Applies To
  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.
You might also like to read
Have a Question?

If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.

1 thought on “Enable debugging in SharePoint Web.Config”

Leave a Reply

Scroll to Top