为什么字符串不会显示在自定义日志事件的事件日志中?

时间:2014-06-18 18:32:34

标签: .net-4.5 etw etw-eventsource

我正在使用new .NET EventSource API from nuget。我已经构建了我的应用程序,并使用wevtutil.exe安装了清单和资源DLL。我在事件查看器中查看时,我的事件日志条目包括以下文本:

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

消息的最后一部分显得特别值得注意:“消息资源存在,但在字符串/消息表中找不到消息。”

为什么我的资源DLL无效?

1 个答案:

答案 0 :(得分:1)

尤里卡!我错误地安装了清单,认为在wevtutil的两个交换机中,一个重复清单文件名,另一个包含DLL文件名。实际上,两者都应该引用DLL。

我现在正在WiX使用此标记执行此操作:

<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>