Monday, February 21, 2011

How to debug a WCF service connected with multiple clients - .NET

Hello

I've written a WCF service with a duplex contract which asynchronously calls back the clients. I have some issues when multiple clients get connected and i dono how to debug the service. Any insights on this?

Thank you.

NLV

From stackoverflow
  • A bit more info on what your problem is would be helpful, but to get you started try enabling diagnostics. Add the following to your service config and set "initializeData" to set where the log file is written. Opening the file should launch Microsoft Service Trace Viewer. You can do the same on the client side. If you have both a service log and client log in Trace Viewer go to Menu -> Add and select the other file. You will then get the message interactions matched up in the graph tab.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      ...
      <system.diagnostics>
        <trace autoflush="true" />
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Verbose">
            <listeners>
              <add name="sdt"
                  type="System.Diagnostics.XmlWriterTraceListener"
                  initializeData="D:\wcfLog.svcLog"  />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    </configuration>
    

    More info here: Tracing

0 comments:

Post a Comment