Friday, March 16, 2012

Tracing WCF Calls

I ran into an issue with one of my WCF services and was having the quite a time trying to track it down, especially since it was failing before it was getting to the actual service.  I came across a nice way of tracing the call all the way through the process.  Add the following section to your web.config file:

    <source name="System.ServiceModel"
            switchValue="Information, ActivityTracing"
        <add name="traceListener"
            initializeData= "C:\Logs\Traces.svclog" />

This will create a trace file that you can open up in the Microsoft Service Trace Viewer.  You can read about the details here.

Quick note – Don’t forget to remove it when you’re done!

No comments:

Post a Comment