Description
openedon Jul 28, 2021
Description
EventLogRecord.GetFormatDescription() throws "The specified resource type cannot be found in the image file." exception. while querying the Windows EventLog
Here is the StackTrace:
at System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)
at System.Diagnostics.Eventing.Reader.NativeWrapper.EvtFormatMessageRenderName(EventLogHandle pmHandle, EventLogHandle eventHandle, EvtFormatMessageFlags flag)
at System.Diagnostics.Eventing.Reader.ProviderMetadataCachedInformation.GetFormatDescription(String ProviderName, EventLogHandle eventHandle)
at HMS.Agent.LogInfoRetriever.<>c.b__1_1(EventRecord o) in C:\Users\RemoteUser\Documents\Projects\Code\HMS\HMS.Agent\LogInfoRetriever.cs:line 153
at System.Linq.Enumerable.SelectEnumerableIterator2.ToList() at HMS.Agent.LogInfoRetriever.<>c__DisplayClass1_0.<GetWindowsEventLogs>b__0() in C:\Users\RemoteUser\Documents\Projects\Code\HMS\HMS.Agent\LogInfoRetriever.cs:line 152 at System.Threading.Tasks.Task
1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
Configuration
- Which version of .NET is the code running on? -- .net 5
- What OS and version, and what distro if applicable? -- Windows 10 build 19043.1110
- What is the architecture (x64, x86, ARM, ARM64)? -- X64
- Do you know whether it is specific to that configuration? -- No