Description
Description
This windows service is migrated recently from .Net framework 4.8 to .Net core (6.0).
The service is crashing on the system shutdown or reboot. This issue was not seen before migrating to .Net 6.0.
The crash is happening in System.Diagnostics.EventLog.dll. Details are added below.
Reproduction Steps
As mentioned above
Expected behavior
The windows service should not crash
Actual behavior
The windows service is crashing
Regression?
No response
Known Workarounds
No response
Configuration
.Net 6.0, Windows 10
Windows Service architecture : x86
Other information
Call Stack after Crash -
KERNELBASE.dll!75e1d8a2() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for KERNELBASE.dll]
[Managed to Native Transition]
System.Diagnostics.EventLog.dll!System.Diagnostics.EventLogInternal.InternalWriteEvent(uint eventID, ushort category,
System.Diagnostics.EventLogEntryType type, string[] strings, byte[] rawData, string currentMachineName) Line 1397
System.Diagnostics.EventLog.dll!System.Diagnostics.EventLogInternal.WriteEntry(string message,
System.Diagnostics.EventLogEntryType type, int eventID, short category, byte[] rawData) Line 1317
System.Diagnostics.EventLog.dll!System.Diagnostics.EventLog.WriteEntry(string message,
System.Diagnostics.EventLogEntryType type) Line 988
System.ServiceProcess.ServiceController.dll!System.ServiceProcess.ServiceBase.WriteLogEntry(string message,
System.Diagnostics.EventLogEntryType type)
System.ServiceProcess.ServiceController.dll!System.ServiceProcess.ServiceBase.DeferredShutdown()
System.ServiceProcess.ServiceController.dll!System.ServiceProcess.ServiceBase.ServiceCommandCallback.AnonymousMethod__3(object _)
System.Private.CoreLib.dll!System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
System.Private.CoreLib.dll!System.Threading.Thread.StartCallback()
[Native to Managed Transition]
kernel32.dll!75b800c9()
ntdll.dll!776f7b4e()
ntdll.dll!776f7b1e()
Unhandled exception at 0x75E1D8A2 (KERNELBASE.dll)