.net-4.5etwetw-eventsource

Why do strings not show in the event log for my custom log events?


I am using the new .NET EventSource API from nuget. I have built my application, and installed the manifest and resource DLL using wevtutil.exe. My event log entries include the following text when I view them in Event Viewer:

The description for Event ID 1 from source XXXX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 


the message resource is present but the message is not found in the string/message table

The last part of the message seems especially notable: "the message resource is present but the message is not found in the string/message table."

Why is my resource DLL not working?


Solution

  • Eureka! I had installed the manifest wrongly, thinking that, of the two switches for wevtutil, one repeated the manifest filename and the other contained the DLL filename. Actually, both should refer to the DLL.

    I'm now doing this in WiX using this markup:

    <Component Id="etwManifest.man" Guid="*">
      <File Id="File.etwManifest.man" 
            Source="$(var.Project.TargetDir)EventSource.Provider-Name.etwManifest.man"
            KeyPath="yes" Vital="yes">
        <util:EventManifest MessageFile="[#File.etwManifest.dll]" 
                              ResourceFile="[#File.etwManifest.dll]" />
      </File>
    </Component>