Tech Talk A software developer on all things tech, and then some

28Nov/110

Including Exception Details in WCF (IncludeExceptionDetailInFaults)

Sometimes when you receive an exception when debugging a WCF service, you receive the following message :

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

What this is asking you to do is to find your Behaviors section and add the following line.

<serviceDebug includeExceptionDetailInFaults="true" />

To find this section, look in your App.config in your server application. Then find the section which has the behaviors tag. Find the behavior for your application, then add the line above. It should resemble the following :

<behavior name="mexbehavior">
   <serviceMetadata httpGetEnabled="True" httpGetUrl="http://ApplicationURL"/>
   <serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
Comments (0) Trackbacks (0)

No comments yet.


Leave a Reply

No trackbacks yet.

%d bloggers like this: