Solved

Windows Error system.io.directorynotfound c#

Posted on 2009-05-07
2
412 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now