Create EventLog source in WiX without an event message file
Asked Answered
M

1

9

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?

Mammillate answered 22/8, 2011 at 16:45 Comment(0)
C
9

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.

Candis answered 22/8, 2011 at 17:27 Comment(2)
That explains a lot! Thanks for the clarification; I feel better jumping through the hoop now I know why it's there :) It shouldn't take much effort to set up a solution I can reuse across projects; I'm sure there are far more important features that the WiX contributors could be spending their time on.Mammillate
I'd say the problem is more than the .NET framework team didn't integrate their stuff with the Windows team very well.Grassgreen

© 2022 - 2024 — McMap. All rights reserved.