Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create EventLog source in WiX without an event message file

I've seen a few questions here and there about creating event log sources using WiX. What puzzles me is why util:EventSource/@EventMessageFile is required. It's annoying having to specify it when you don't need a message file to write event log entries, and the abstraction offered by .NET's System.Diagnostics.Trace doesn't expose the ability to use one.

The standard advice seems to be to use a directory search to set the attribute to the Framework's EventLogMessages.dll, but nobody repeating this mantra ever gives any justification for it.

Short of not using the (tested, robust) custom actions supplied with WiX, is there any way to get around this requirement?

And why do authors of managed applications which don't use this aspect of the event log take such pains to (apparently) pointlessly refer to a Framework DLL rather than one of their own executables?

like image 948
anton.burger Avatar asked Aug 22 '11 16:08

anton.burger


1 Answers

An event message file is required, per MSDN: http://msdn.microsoft.com/en-us/library/aa363680%28v=VS.85%29.aspx. .NET supplies one automatically -- and yes, it's EventLogMessages.dll -- when you use the Trace class (or EventLog, which Trace uses).

Feel free to file a feature request to have WiX fill in EventLogMessages.dll automatically.

like image 168
Bob Arnson Avatar answered Oct 26 '22 22:10

Bob Arnson