找到exe的配置文件

app.config为开发时模板

appname.exe.config为实际运行配置

 

在appname.exe.config中</configuration>上面增加以下节点

 

<system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "mywcf.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

wcf启动后会在exe所在目录生成mywcf.svclog直接用诊断工具或者双击打开 就能查看每次交互过程 太方便了

 

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-09-06
  • 2021-07-08
  • 2021-11-04
  • 2021-12-12
  • 2021-07-07
猜你喜欢
  • 2021-09-21
  • 2021-10-01
  • 2021-07-04
  • 2022-02-18
  • 2021-11-06
  • 2021-09-02
  • 2022-12-23
相关资源
相似解决方案