473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

what i missing?

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.filenotfoundexception!!! :(
Oct 26 '09 #1

✓ answered by tlhintoq

That's fine. But you still have the same major issues:
  1. You are trying to access a file that exists on your developer PC that doesn't exist on your other machines
  2. 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:
Expand|Select|Wrap|Line Numbers
  1. Graphics g = Graphics.FromImage(m_Undo);
Presumes that m_Undo must be good (not null)(actually exists)(not in use)(you have permissions)(doesn'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:
Expand|Select|Wrap|Line Numbers
  1. if (m_Undo != null)
  2. {
  3.    bool bSuccess = false;
  4.    // Do your thing here
  5.    bSuccess = true;
  6.    // Hurray, your thing worked!
  7.  
  8.    if (bSuccess)
  9.    {
  10.       // Then do this other thing if it worked
  11.    }
  12.    else
  13.    {
  14.       // Then do the failure recovery part / user failure message
  15.    }
  16.  
  17.    return bSuccess; // If you want the calling method to know if it worked.
  18. }

7 1376
tlhintoq
3,525 Expert 2GB
filenotfoundexception
what i missing?
The file you are looking for.

Sistem.io.filenotfoundexception
wen i try to rum
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.
Oct 26 '09 #2
Excuse me,

I'm writing from my cell phone.
Error messege:
System.io.filenotfoundxception!

Regards,
Oct 26 '09 #3
tlhintoq
3,525 Expert 2GB
That's fine. But you still have the same major issues:
  1. You are trying to access a file that exists on your developer PC that doesn't exist on your other machines
  2. 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:
Expand|Select|Wrap|Line Numbers
  1. Graphics g = Graphics.FromImage(m_Undo);
Presumes that m_Undo must be good (not null)(actually exists)(not in use)(you have permissions)(doesn'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:
Expand|Select|Wrap|Line Numbers
  1. if (m_Undo != null)
  2. {
  3.    bool bSuccess = false;
  4.    // Do your thing here
  5.    bSuccess = true;
  6.    // Hurray, your thing worked!
  7.  
  8.    if (bSuccess)
  9.    {
  10.       // Then do this other thing if it worked
  11.    }
  12.    else
  13.    {
  14.       // Then do the failure recovery part / user failure message
  15.    }
  16.  
  17.    return bSuccess; // If you want the calling method to know if it worked.
  18. }
Oct 26 '09 #4
thanks.
I think a found a peace of my problem.
On my InitializeComponent()
i write the following code, and the second messege never show on my PC.
Expand|Select|Wrap|Line Numbers
  1. public ControlAc()
  2.         {
  3.             MessageBox.Show("First messege");
  4.             InitializeComponent();
  5.             MessageBox.Show("Second Messege"); //this messege was never display.
  6.         }
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.
Oct 26 '09 #5
the exception trow the following messege!

Could not load file or assembly CrystalDecisions.Windows.Forms, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'

I thinki'm close :(
Oct 27 '09 #6
tlhintoq
3,525 Expert 2GB
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



Expand|Select|Wrap|Line Numbers
  1. public ControlAc()
  2.         {
  3.             MessageBox.Show("First messege");
  4.             InitializeComponent();
  5.             MessageBox.Show("Second Messege"); //this messege was never display.
  6.         }
C) Its best to not try to do things before you even InitializeCompoents. After all, how can you do anything with anything if your parts don't exist yet?
  • Put a breakpoint on line "InitializeComponent();
  • 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.
Oct 27 '09 #7
thanks a lot,

I appreciate all your help!!!
My problem was that i missing all the DLL from crystalreports.
crystalreport.windowsform
crystalreport.share
etc.

regards,
Oct 27 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

28
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are...
5
by: SimpSity | last post by:
I am a complete noob, what book would be the best for complete begginers, u know the ones that could teach a a retarted neborn monkey to program C++ thats the kind of thing im looking for alotr of...
112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
1
by: Sarah | last post by:
Hello. I am using Microsoft.Office.Interop.Excel in a C# .NET project. I want to open an Excel application with a specific file name. I am currently opening it with this code: ...
1
by: bradleyc | last post by:
Definately need my eyes checked... Error:asstester.cpp(300,1):Declaration missing ; Error:asstester.cpp(300,1):Compound statement missing } void doModify() { clrscr(); char inputv,...
0
by: kris | last post by:
hi can any one help me out, i have written a code for Word Indexing using Dll's i think this is an incomplete code for WORD INDEX. I had encountered this error "Error! No index entries found"...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
10
by: Protoman | last post by:
Could you tell me what's wrong with this program, it doesn't compile: #include <iostream> #include <cstdlib> using namespace std; class Everything { public: static Everything* Instance()
5
by: le0 | last post by:
Hello guys, Im really having a hard time doing this, I have a record set with the ItemNo field with the data type as Text. In the record that I have, I want to find the missing number in the...
20
by: mc | last post by:
I may be opening a can of worms and don't want to start a religious war, but... What features of Java do Java programmers miss when working in C#? Other than, of course, great portability. C#...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.