When using System.Diagnostics.Eventing.Reader.EventLogQuery to read events from the Windows Event Log, the EventRecord.FormatDescription() method sometimes returns null. Why is this? In the Event Viewer there are messages on the events which return null.
When using System.Diagnostics.Eventing.Reader.EventLogQuery to read events from the Windows Event Log, the EventRecord.FormatDescription() method
Share
This is due to a bug in the .NET framework.
Basically what you need to do to work around this bug is to set the CurrentCulture to “en-US”.
Example:
This workaround
iswas very hard to find, so I thought I would document it a place where it will be indexed by Google. I found it in an old MS Connect case, but it has been closed with a status of “wont fix”.UPDATE:
The bug has been reported for .NET 4 as well and the status is “Sent to Engineering Team for consideration” and comment alluding that the bug might be fixed in the next major .NET framework release (v5).