Enable Debugging and set custom errors off in SharePoint

Posting this snippet so that I can always find it when I need it.

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

  • 1. Turn on the call stack in the SafeMode entry
    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

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

w

Conectando a %s