如何调试与多个客户端连接的 WCF 服务 - .NET

发布于 2024-09-07 19:41:59 字数 104 浏览 2 评论 0原文

我编写了一个带有双工合约的 WCF 服务,该合约异步回调客户端。当多个客户端连接时,我遇到一些问题,并且我不知道如何调试服务。对此有什么见解吗?

谢谢。

自然LV

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

|煩躁 2024-09-14 19:41:59

有关您的问题的更多信息会有所帮助,但要让您开始尝试启用诊断。将以下内容添加到您的服务配置中并设置“initializeData”以设置日志文件的写入位置。打开该文件应启动 Microsoft 服务跟踪查看器。您可以在客户端执行相同的操作。如果您在跟踪查看器中同时有服务日志和客户端日志,请转到菜单 ->添加并选择其他文件。然后,您将在图表选项卡中获得匹配的消息交互。

<?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>

更多信息请参见:跟踪

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文