I am trying to write custom events from my web application to the Windows event log. Iām unlucky that the message lines are working, I keep getting "Description for event ID X in source Y could not be found."
In an attempt to narrow it down, I decided to write the event to a source that already exists on my machine. I just looked at one of the events that were already written out, in particular the SceCli 1704 event.
I am executing the following code:
var log = new EventLog("Application"); log.Source = "SceCli"; var ev = new EventInstance(1704, 0, EventLogEntryType.Information); log.WriteEvent(ev);
However, this still gives me the following in the event viewer:
Cannot find description for event ID (1704) in source (SceCli). The local registry may not display the necessary registry data or message DLL files to display messages from a remote computer. You can use the / AUXSOURCE = flag to get this description; see Help and Support. The following information is part of an event: The event log file is corrupt.
I'm not sure what I am missing here. I am writing the same event that already exists, and it still cannot find the message line.
source share