on developer pc my app works great, wen i try to rum my app on others pc i have the same error report, to sent to microsoft. Sistem.io.filen otfoundexceptio n!!! :(
what i missing?
Collapse
X
-
Tags: None
-
The file you are looking for.filenotfoundexc eption
what i missing?
Along with ability to proofread your typing. I don't say this to be mean. Programming languages are picky and require exactness. "File" is different than "file". "Sistem" is not the same as "System". If you can't be bothered with paying attention to what you are doing/typing then you will just make a lot of extra work for yourself.Sistem.io.filenotfoun dexception
wen i try to rum -
Excuse me,
I'm writing from my cell phone.
Error messege:
System.io.filen otfoundxception !
Regards,Comment
-
That's fine. But you still have the same major issues:- You are trying to access a file that exists on your developer PC that doesn't exist on your other machines
- Your code is not robust enough to handle a situation that isn't perfect. It just assumes that the file is there and when it isn't the code doesn't recover gracefully.
I can make some suggestions.- Assume that everything is broken, or at least not ideal.
- Presume that the user is going to provide data in a format or manner that you just didn't expect. If you use a textbox for a number, the user will type "One".
- Assume that hardware breaks in the middle of what you are doing, so you have to recover.
- Take a few extra lines of code to get standards like the boot drive, the number thousands seperator etc. Don't assume that you have a C: drive or that a comma is the separator because not everyone is in America.
- Check that files/folders exist, even if you just did a call to make it: You may not have permissions.
- Don't assume the harddrive has room for what you are doing: They do fill up. Usually right in the middle of you writing to your log file.
- Get used to placing breakpoints and walking through the code line by line. Double check EVERYTHING on every line. Keep the "Locals" and "Autos" windows open so you can see your values.
- Put a breakpoint on line 1.
- When the code stops there, walk through line by line with F-10.
- Check the values of your assumptions.
- Stop. Breath. Relax. Then reason out the problem. Cut it down by sections or halves. "The value was good here, then at this method it wasn't. Where did it go between 'A' and 'B'?"
- Range check and validate values. Confirm that you didn't get a zero when you are only set to accept 1-10. Confirm your objects and values aren't null. Initialize them to a known default if possible. If a selection can be from 0-10, then initialize to -1: Now you have something to check for.
Example:
Presumes that m_Undo must be good (not null)(actually exists)(not in use)(you have permissions)(do esn't time out when accessed). If that assumption fails so does your program, because you can't make anything from a file if the file is null. Get used to validating data and assumptions in your code if you want it to be robust. For example:Code:Graphics g = Graphics.FromImage(m_Undo);
Code:if (m_Undo != null) { bool bSuccess = false; // Do your thing here bSuccess = true; // Hurray, your thing worked! if (bSuccess) { // Then do this other thing if it worked } else { // Then do the failure recovery part / user failure message } return bSuccess; // If you want the calling method to know if it worked. }Comment
-
thanks.
I think a found a peace of my problem.
On my InitializeCompo nent()
i write the following code, and the second messege never show on my PC.
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.Code:public ControlAc() { MessageBox.Show("First messege"); InitializeComponent(); MessageBox.Show("Second Messege"); //this messege was never display. }Last edited by tlhintoq; Oct 27 '09, 12:55 AM. Reason: [CODE] ...your code here...[/CODE] tags addedComment
-
the exception trow the following messege!
Could not load file or assembly CrystalDecision s.Windows.Forms , Version=10.2.36 00.0, Culture=neutral , PublicKeyToken= 692fbea5521e130 4'
I thinki'm close :(Comment
-
A) That is like a mile of code. Way beyond what is pertinent.
B) Looks like it is the automatically generated code by Visual Studio. If you didn't go behind the back of VS and make a bunch of changes, then it's safe to say this isn't where the problem is. What would be more relevant is the code that *you* wrote in your class(es) WHERE THE BREAK OCCURS
C) Its best to not try to do things before you even InitializeCompo ents. After all, how can you do anything with anything if your parts don't exist yet?Code:public ControlAc() { MessageBox.Show("First messege"); InitializeComponent(); MessageBox.Show("Second Messege"); //this messege was never display. }
- Put a breakpoint on line "InitializeComp onent();
- When the code stops there, walk through line by line with F-10 and/or F-11 as appropriate.
- Check the values of your assumptions.
Comment
-
thanks a lot,
I appreciate all your help!!!
My problem was that i missing all the DLL from crystalreports.
crystalreport.w indowsform
crystalreport.s hare
etc.
regards,Comment
Comment