There is a known bug in the .NET COM port class, see this thread for details:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8a1825d2-c84b-4620-91e7-3934a4d47330
If you are using the .NET ports class, there is a fix you can add to your code. Right after you open the COM port, add this line:
GC.SuppressFinalize(serialPort.BaseStream)
Without the fix, your plug-in may throw an error and terminate HomeSeer. This can happen if the COM port you are using disappears, maybe its a virtual com port and someone unplugged the USB connection.
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8a1825d2-c84b-4620-91e7-3934a4d47330
If you are using the .NET ports class, there is a fix you can add to your code. Right after you open the COM port, add this line:
GC.SuppressFinalize(serialPort.BaseStream)
Without the fix, your plug-in may throw an error and terminate HomeSeer. This can happen if the COM port you are using disappears, maybe its a virtual com port and someone unplugged the USB connection.