gpt4 book ai didi

wcf - 如何开启WCF跟踪?

转载 作者:行者123 更新时间:2023-12-03 04:21:04 25 4
gpt4 key购买 nike

更新:

我一直在尝试打开WCF追踪,但仍然没有成功...以下是我的最新更新。

我需要获得写入以下位置的权限吗?

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

我正在使用 .NET Framework 3.5。

打开 WCF 跟踪以进行调试的分步说明是什么?

最佳答案

以下配置取自MSDN可以应用于在您的 WCF 上启用跟踪服务。

<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true" >
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="myUserTraceSource"
switchValue="Information, ActivityTracing">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="Error.svclog" />
</sharedListeners>
</system.diagnostics>
</configuration>

要查看日志文件,可以使用“C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcTraceViewer.exe”。

如果您的系统上没有“SvcTraceViewer.exe”,您可以从此处的“Microsoft Windows SDK for Windows 7 and .NET Framework 4”包下载它:

Windows SDK Download

您不必安装整个内容,只需安装“.NET 开发/工具”部分即可。

当/如果它在安装过程中因无意义的错误而崩溃,Petopas' answer to Windows 7 SDK Installation Failure解决了我的问题。

关于wcf - 如何开启WCF跟踪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4271517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com