How to enable debugging in SharePoint Solutions?

In this hint, I will elaborate How to

  • Debugging SharePoint Solutions?
  • Show the detail error message for SharePoint Web Application?
  • Show the detail error message for SharePoint Central Administration?
  • How to Debugging SharePoint Solutions?
    • Via any editor tools like NotePad++ or notepad > Open the web.config located in  "C:\Inetpub\wwwroot\wss\VirtualDirectories\ PortNum".
      • Note: Open NotePad as administrator > Open web.config through it.
    • Find the <compilation debug="false">
    • Set the debug value to True to be as the following<compilation debug="false">.
    • Save.

Before modifying the web.config it is heavily recommended to backup it.

  • How to Show the detail error message for SharePoint Web Application?
    • In the same config file of your web application,
    • Find <SafeMode  CallStack="false" > and set it to <SafeMode CallStack="true">
    • Find <customErrors mode="On" /> and set it to <customErrors mode="Off" />
    • Save.

You should apply the above changes to all WFE SharePoint servers within your farm.

  • How to Show the detail error message for SharePoint Central Administration?
    • Open IIS > Right Click on your Central Administration Site.
    • Open the web.config Via any editor tools like NotePad++ or notepad.
    • Find <customErrors mode="On" /> and set it to <customErrors mode="Off" />
    • Find <SafeMode  CallStack="false" > and set it to <SafeMode CallStack="true">
    • Save.
    • Again, Open the web.config located in "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts"
    • Find <customErrors mode="On" /> and set it to <customErrors mode="Off" />
    • Save.
    • Again, Open the web.config located in "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\ADMIN"
    • Find <customErrors mode="On" /> and set it to <customErrors mode="Off" />
    • Save.

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

The List of all web config files paths included in SharePoint

  • \\Inetpub\wwwroot\wss\VirtualDirectories\ Port_Number.
    •  The web.config file that defines configuration settings for a SharePoint content Web application.
  • \\Inetpub\wwwroot\wss\VirtualDirectories\ Port_Number_of_Central_Administration.
    • The web.config file that defines configuration settings for the SharePoint Central Administration application.
  • %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\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\14\ISAPI
    • The web.config file that defines configuration settings for the /_vti_bin virtual directory.
  • %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS
    • The web.config file that defines configuration settings for the /_layouts virtual directory.
  • %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\ADMIN
    • The web.config file that defines configuration settings for pages used in SharePoint Central Administration.

14 hive for SharePoint 2010 and 15 hive for SharePoint 2013.

Enjoy 🙂

Advertisements

One thought on “How to enable debugging in SharePoint Solutions?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s