.Net runtime 2.0 error, Event id: 5000

K

kimtherkelsen

Hi,
I have made some software that uses one of the COM ports to
communicate with an external device. The software is written in C# and
uses the new SerialPort class in .Net 2.0.
It works perfectly when I use the COM ports that are integrated in my
PC. It also works if I use a COM->RS232 converter as long as I don't
unplug the converter when the software is running. If I unplug the
converter I get a .Net runtime 2.0 error:
http://therkelsen.info/images/blandet/atrack_prob.JPG

This error makes the .Net runtime environment shut down my software
and it seems like there is nothing I can do about it. I can not catch
the "objectDisposedException" because it is thrown inside the .Net
environment and makes the environment crash.
Any ideas about what I can do to stop the framework from crashing?
Is this a known bug in the .Net framework?

Best regards,
Kim Therkelsen
 
K

kimtherkelsen

Thank you. I solved the problem by making a .config file file the same
name as the exe file and with the following contents:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<legacyUnhandledExceptionPolicy enabled="true" />
</runtime>
</configuration>

This hack solves the problem but I still hope that Microsoft will fix
the error in their SerialPort class.

Best regards,
Kim Therkelsen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top