Problem with Custom Event Logs


Simon Johnson

I'm having trouble creating a custom event log.

Here's my Code:

static void Main(string[] args)
if (!EventLog.SourceExists("OnlineTonnages"))

EventLog ApplicationLog = new EventLog();
ApplicationLog.Source = "OnlineTonnages";
ApplicationLog.MachineName = Environment.MachineName;
ApplicationLog.Log = "EWC Applications";



It compiles and runs without error.. However, when I check the Event Viewer
to see if my log contains the test message I find that although the log has
been created and appears in the Event Viewer the Events don't go against the
log. Instead they appear in the application log with the following message:

"The description for Event ID ( 0 ) in Source ( OnlineTonnages ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: Test!"

Is this a bug in the framework or something i'm doing incorrectly?


Andy Gaskell

Ensure that
Applications\OnlineTonnages\EventMessageFile is pointing to

On my system the path is

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question