Home > WCF

How to get exception details pushed to client when using WCF web service

11. February 2013

We can enable this setting by including the below code in webconfig of WCF web service . By adding the tag <serviceDebug includeExceptionDetailInFaults="true"/> we can get the details of the specific exception raised at server side into client side when Debugger is attached with client application .

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

WCF

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading