【问题标题】:Why do strings not show in the event log for my custom log events?为什么我的自定义日志事件的事件日志中不显示字符串?
【发布时间】:2014-06-18 18:32:33
【问题描述】:

我正在使用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 不起作用?

【问题讨论】:

    标签: .net-4.5 etw etw-eventsource


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      • 2015-11-30
      • 1970-01-01
      相关资源
      最近更新 更多