Solved

Windows Error system.io.directorynotfound c#

Posted on 2009-05-07
2
418 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:borntofly
2 Comments
 
LVL 13

Expert Comment

by:iHadi
ID: 24323884
Hi borntofly,

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.
0
 

Accepted Solution

by:
borntofly earned 0 total points
ID: 24492448
I solved the problem....

It was a problem with the setup file.

Thank you
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question