Thursday, September 13, 2007

WCF Debugging with SvcTraceViewer

While debugging my recent WCF problems, I ran across this utility that I had forgotten about. SvcTraceViewer is a tool that helps visualize and analyze diagnostic traces generated by WCF. Not only does it show you every message received and sent, but in graph mode it give you a quasi-sequence diagram of activities.

You can enable tracing by adding a section to the config file:

    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
                <listeners>
                    <add name="traceListener"
                        type="System.Diagnostics.XmlWriterTraceListener"
                        initializeData= "c:\log\Traces.svclog" />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

This will send the tracing info to a log file which then you can open with SvcTraceViewer;

Here's the link to more information: http://msdn2.microsoft.com/en-us/library/ms732023.aspx

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home