6
Answers

Error while fetching EventLog entries

priyanka

priyanka

15y
4k
1

Hi All,
I have created a tool in c#, which is 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 this 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 to fetch the details 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 framework or with the machine's event log.
Any kind of help will be highly appreciated
Thanks,
Priyanka
Answers (6)