I have this small piece of code to read "System" events from eventvwr
EventLog eventLog = new EventLog("System");
foreach (EventLogEntry log in eventLog.Entries)
{
Console.WriteLine("{0}\n", log.Message);
}
This works fine but for few event logs i get messages like
"The description for Event ID '109' in Source 'Microsoft-Windows-Kernel-Power' 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:'6', '0', '5'"
And when i open eventvwr, i can see the description there.
The kernel power manager has initiated a shutdown transition.
Shutdown Reason: Kernel API
I am running this code as an admin.
Can anyone help me figure out why am i getting such messages for description. Thanks in advance
There are similar posts but none raises this issue. for example this
"The description for Event ID X in Source Y cannot be found."