borntofly
asked on
Windows Error system.io.directorynotfound c#
Hello,
I have a software tha uses serialport via a usb to serialport cable. I need to monito if the cable is disconnected. In a timer a check it with serialport.IsOpen and if case it is closed i open a new form for the com setting. If I save the new settings, the software save them in an xml file and restart the application where the new settings will be read from the xml.
If i manually call the setting page, every thing works fine, but if it's called by the serialport.IsOpen check, so when the cable is disconnected, I get a windows error at the restart and if I close the program it won't start again. Attached the error I get.
Thank you very much for the help.
P.S. I do not get any error in the debug, but only using the compilied file.
error.JPG
I have a software tha uses serialport via a usb to serialport cable. I need to monito if the cable is disconnected. In a timer a check it with serialport.IsOpen and if case it is closed i open a new form for the com setting. If I save the new settings, the software save them in an xml file and restart the application where the new settings will be read from the xml.
If i manually call the setting page, every thing works fine, but if it's called by the serialport.IsOpen check, so when the cable is disconnected, I get a windows error at the restart and if I close the program it won't start again. Attached the error I get.
Thank you very much for the help.
P.S. I do not get any error in the debug, but only using the compilied file.
error.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you post the stack trace of the error if its a .net exception.
Also can you post the code of the saving and loading of the settings xml file.