Please use the Microsoft.Diagnostics.Tracing.EventSource NuGet Package to use ETW in .Net.
Here is a sample class:
[EventSource(Name = "Samples-EventSourceDemos-EventLog")]
public sealed class MinimalEventSource : EventSource
{
public static MinimalEventSource Log = new MinimalEventSource();
[Event(1, Message="{0} -> {1}", Channel = EventChannel.Admin)]
public void Load(long baseAddress, string imageName)
{
WriteEvent(1, baseAddress, imageName);
}
}
This is much better compared to the old C++ way.