How to debug “Safe handle has been closed” error

前端 未结 1 1063

Code which I have inherited keeps crashing out rather powerfully with the following error (not changed at all):

System.ObjectDisposedException: Safe handle h         


        
相关标签:
1条回答
  • 2021-01-11 17:24

    From the fact that System.IO.Ports.SerialStream.EventLoopRunner.WaitForCommEvent() and Microsoft.Win32.UnsafeNativeMethods are referred to I would hazard that you have a COM component that has internal threads accessing a port e.g. for serial or TCP/IP data.

    It would look like the thread throws an exception during it's start sequence. Possibly it is trying to access an unavailable or nonexistant port. This fails and the exception is not handled and thus propogates back through the code.

    Trying logging more information from the UnhandledException Event in order to get an idea of where this may start from.

    0 讨论(0)
提交回复
热议问题