Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net 4.5 EventSource ETW provider not showing up in provider list

I have been working on using .NET4.5 new feature ETW(EventSource). I have trouble having it show up on the trace provider lists using perfmon->Data Collector Sets. I was able to see the logs using perfview. I was able to generate manifest from EventSource class using its static method GenerateManifest. This will provide the manifest of myevents in EventSource class but it does not contain details about the channels.

My question is how to add channel specific information after generating the manifest file for perfmon tracing session? I also would like to use the Perfmon's Tracing session to enable the provider instead of perfview.

Any input is much appreciated.

like image 827
Rajesh B Avatar asked Jul 10 '13 01:07

Rajesh B


1 Answers

MS released a Nuget package which registers the EventSource class after build:

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.

After registering it you should see it in all tools which read the installed providers.

like image 175
magicandre1981 Avatar answered Oct 07 '22 18:10

magicandre1981