You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that at least one event in particular, an Office 2016 Licensing Service event with a level of Error in the Application Log would crash EventFinder. Reading this log would crash things with an EventLogNotFoundException reading "The system cannot find the file specified". I have no idea why this is the exception thrown.
This only appeared to crash when setting LevelDisplayName, OpcodeDisplayName, and TaskDisplayName. This doesn't seem to be due to null values. First, the error is wrong. I also tried checking for nulls via if statements (string != null) and String.IsNullOrEmpty().
I solved this by adding several try/catch statements for these variables that seem to do nothing, but it works now.
The attached zip file contains the CSV output after the try/catch statements were put in place. Line 5 contains the offending log line (note that there is no message! Spooky!). It also contains the log itself.
Below is the exception.
- $exception {"The system cannot find the file specified"} System.Diagnostics.Eventing.Reader.EventLogNotFoundException
System.Diagnostics.Eventing.Reader.EventLogNotFoundException
HResult=0x80131500
Source=System.Core
StackTrace:
at System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)
at System.Diagnostics.Eventing.Reader.NativeWrapper.EvtOpenProviderMetadata(EventLogHandle session, String ProviderId, String logFilePath, Int32 locale, Int32 flags)
at System.Diagnostics.Eventing.Reader.ProviderMetadata..ctor(String providerName, EventLogSession session, CultureInfo targetCultureInfo, String logFilePath)
at System.Diagnostics.Eventing.Reader.ProviderMetadataCachedInformation.GetProviderMetadata(ProviderMetadataId key)
at System.Diagnostics.Eventing.Reader.ProviderMetadataCachedInformation.GetLevelDisplayName(String ProviderName, EventLogHandle eventHandle)
at System.Diagnostics.Eventing.Reader.EventLogRecord.get_LevelDisplayName()
at EventFinder.FindEvents.FindEventsButton_Click(Object sender, EventArgs e) in C:\Users\BBK\source\repos\EventFinder2\EventFinder\Form1.cs:line 130
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at EventFinder.Program.Main() in C:\Users\BBK\source\repos\EventFinder2\EventFinder\Program.cs:line 19
I found that at least one event in particular, an Office 2016 Licensing Service event with a level of Error in the Application Log would crash EventFinder. Reading this log would crash things with an EventLogNotFoundException reading "The system cannot find the file specified". I have no idea why this is the exception thrown.
This only appeared to crash when setting LevelDisplayName, OpcodeDisplayName, and TaskDisplayName. This doesn't seem to be due to null values. First, the error is wrong. I also tried checking for nulls via if statements (string != null) and String.IsNullOrEmpty().
I solved this by adding several try/catch statements for these variables that seem to do nothing, but it works now.
The attached zip file contains the CSV output after the try/catch statements were put in place. Line 5 contains the offending log line (note that there is no message! Spooky!). It also contains the log itself.
Below is the exception.
CrashEvent.zip
The text was updated successfully, but these errors were encountered: