Sample code for my related blog post
- VS2017 or higher
- Microsoft Message Analyzer (if you want to capture the test output.)
- Open the Solution and build the project. This will create an executable called
etw_hello_world.exe. - Edit helloworldmetric.man in a text editor and update
resourceFileNameandmessageFileNamewith the full path to the builtetw_hello_world.exethen save the file. - Open an Administrator command prompt and
cdinto the projectsrcdirectory. - Run
wevtutil im helloworldmetric.manto install the manifest. The exe file must be built and the path to it must be correct for this to work. - Now you can open Microsoft Message Analyzer or whatever tool and you should be able to add the
Hello World Metric Providersystem provider. - Run
etw_hello_world.exeto log the messages.
You must have the manifest file you used to register in order to unregister the provider.
- Open an Administrator command prompt and
cdinto the projectsrcdirectory. - Run
wevtutil um helloworldmetric.manto uninstall the manifest.