.net-4.5 - .Net 4.5 EventSource ETW 提供程序未显示在提供程序列表中

标签 .net-4.5 etw etw-eventsource

我一直致力于使用 .NET4.5 新功能 ETW(EventSource)。我无法使用 perfmon->Data Collector Sets 将其显示在跟踪提供程序列表中。我能够使用 perfview 查看日志。
我能够使用其静态方法 GenerateManifest 从 EventSource 类生成 list 。这将在 EventSource 类中提供 myevents 的 list ,但它不包含有关 channel 的详细信息。

我的问题是如何在为 perfmon 跟踪 session 生成 list 文件后添加 channel 特定信息?我还想使用 Perfmon 的跟踪 session 来启用提供程序而不是 perfview。

任何输入都非常感谢。

最佳答案

MS 发布了一个 Nuget 包,它在构建后注册 EventSource 类:

http://blogs.msdn.com/b/dotnet/archive/2013/08/09/announcing-the-eventsource-nuget-package-write-to-the-windows-event-log.aspx

Registering your EventSource

When you install the EventSource NuGet package, the build step previously mentioned generates the following files for each EventSource in your application:

<AssemblyName>.<EventSourceTypeName>.etwManifest.man
<AssemblyName>.<EventSourceTypeName>.etwManifest.dll.

These files need to be registered with the operating system to enable channel support. To do this you run the following command after the files are in their final deployed location:

wevtutil.exe im <EtwManifestManFile> /rf:"<EtwManifestDllFile>" /mf:"<EtwManifestDllFile>"

Once this registration command is executed, all subsequent calls to MinimalEventSource.Log.Load(), from any process on that machine, will automatically result in events in the Windows Event log.



注册后,您应该会在所有读取已安装提供程序的工具中看到它。

关于.net-4.5 - .Net 4.5 EventSource ETW 提供程序未显示在提供程序列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17560826/

相关文章:

asp.net - 使用 ETW 捕获传入 HTTP 请求和传出 HTTP 请求

.net - 是否可以在 ETW 中对 EventSource 进行子类化?

c# - 如何使用来自 ETW Microsoft-Windows-TCPIP 提供程序的 TCB 值来获取 TCB 信息

.net - 使用 EventSource 记录 ETW 丢失事件的风险

c# - 基于等待任务的队列

c# - JSON 序列化输出具有 C# 转义格式

msbuild - 在机器上未安装 4.5 运行时的情况下构建 4.5 代码?

c# - 创建简单数学公式的表达式

c# - 在进程外语义日志记录(SALB)C#中将OpCode附加到事件名称