Reputation: 1754
I am using using class System.IO.Ports. In some cases this component still runs even when the program is closed. As a result I can not open the new serial port with the same port name, cause it is already opened.
Please, is there any way how to dispose System.IO.Ports in c#?
Upvotes: 1
Views: 974
Reputation: 19765
When you say "this component still runs..." are you using some 3rd party tool to communicate with the Serial port? Because if you're using System.IO.Ports.Serial, and you properly dispose of it (uinsg a 'using' block) it whould be closed, certainly after your program ends.
Upvotes: 3