I am trying to write to the EventLog from a WindowsService that I have written,
however when I check to see if the Event Log exists (which it does) it fails.
Here's the code.
if (EventLog.SourceExists(this.szLogName.ToString()) == false)
Here are all the iterations of the above that do not work:
if (!EventLog.SourceExists(this.szLogName))
if (EventLog.SourceExists(this.szLogName) == false)
It will work if I explicitly use the string value of this.szLogName, but it
is not my
prefered method.
Any thoughts?