Question

I've got a WCF service which swallows up exceptions thrown in called methods and passing them on to the client. This is fine for DEBUG mode, and I've got a feeling I turned this functionality on, but how do you turn it off?

Any help much appreciated.

Was it helpful?

Solution

Check the includeExceptionDetailInFaults attribute of the serviceDebug element in the web.config file for your service. Setting this attribute to "false" should prevent exception details from being returned to the client.

<behaviors>
  <serviceBehaviors>
    <behavior name="httpsBehavior">
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top