Debug and Trace WCF Exception Message

This is WCF run on IIS 7.5. When runs on Visual Studio (locally), everything looks good. But when deploying in IIS, it shows the below message:

How frustrating are as a developer when you see below error message?

To enable debug / tracing in WCF and display the exception message, change “includeExceptionDetailInFaults” attribute of “serviceDebug” tag in the config file to true.

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DefaultServiceBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>

Better, huh?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s