Enable Debugging and set custom errors off in SharePoint

The original post is here:

https://blogs.msdn.microsoft.com/voyage/2014/09/02/enable-debugging-and-set-custom-errors-off-in-sharepoint/

Thanks Deepa Lakhani.

To debug a SharePoint solution you need to set following values in web.config

  • 1. Turn on the call stack (CallStack=”true”)
  • 2. Disable custom errors (<customErrors mode=”Off” />)
  • 3. Enable debugging (<compilation debug=”true”>)

Go to \\Inetpub\wwwroot\wss\VirtualDirectories\ Port_Number

This web.config defines configuration settings for a SharePoint Web application.

Now you might still get custom error message on your application page and not the real exception.

This happens because there are web.config at other places too in SharePoint.  So for configuration of layouts directory where an application page resides, you need to change the web.config at following location too.

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS — The web.config file that defines configuration settings for the /_layouts virtual directory

Additonal Notes from msdn.

Web.config files are contained in the following folders within the file system:

  • \\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\15\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\ISAPI — The web.config file that defines configuration settings for the /_vti_bin virtual directory.
  • %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS — The web.config file that defines configuration settings for the /_layouts virtual directory
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

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