Error while capturing events from an eventLog

rain_dew12

Newcomer
Joined
Oct 6, 2009
Messages
2
Hi All,

I have created a tool in c#, which monitors the eventlog ( security log) and fetches the details of every new entry.

The tool runs fine on one of the machines, but on another machine it runs well for some time and then starts giving the following error:

"The description for Event ID '0' in Source '' cannot be found.
The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them. The following information is part of the event: "

The code is as follows:

if (eventLog == null)
{
eventLog = new EventLog("Security");
eventLog.EntryWritten += new EntryWrittenEventHandler(EntryToLog);
}
eventLog.EnableRaisingEvents = true;
...
...
private void EntryToLog(Object source, System.Diagnostics.EntryWrittenEventArgs e)
{
< captures various details of e and proccessed them accordingly
}


I am not able to figure out if the problem is with the tool, the .net framework or with the machine's event log.

Any kind of help will be highly appreciated

Thanks!
 
Back
Top