[ACCEPTED]-How to debug "Safe handle has been closed" error-exception

Accepted answer
Score: 10

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

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

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

More Related questions