March 14, 2016

Display error details with custom SharePoint WCF Service

Problem

I always keep forgetting how to configure web.config file in order to display verbose error messages thrown by custom WCF services you create for SharePoint (the ones under _vti_bin). That will greatly help when you try to debug problems in custom solutions.

Solution


In %PROGRAMFILES%\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\web.config within system.serviceModel\behaviors\serviceBehaviors add:

<behavior>
    <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>


This will display verbose / detailed error messages of your WCF service.

No comments:

Post a Comment