Почему строки не отображаются в журнале событий для моих настраиваемых событий журнала?

Я использую новый .NET EventSource API от nuget. Я создал свое приложение и установил манифест и библиотеку ресурсов, используя wevtutil.exe. Мои записи в журнале событий содержат следующий текст, когда я просматриваю их в средстве просмотра событий:

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 не работает?


person Olly    schedule 18.06.2014    source источник


Ответы (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>
person Olly    schedule 18.06.2014