running c# executable....

  • Thread starter Thread starter tracernet_v2
  • Start date Start date
T

tracernet_v2

fellow c# programmers...

i need some help....
i have created a program, a module that is part of another bigger
program...
when i debug it, by pressing F5 in the IDE, it runs so well i can
hardly wait to show it to my project leader...
but when i try to run the executable created by the IDE, the .exe file
in the Debug folder, it catches exceptions and stops the program...

what bothers me so much is that:
1) it runs so well when i debug it(pressing F5 in the IDE), but the
..exe file doesnt...
2) my deadline is already here!!!!!!!

please tell me what to do with this one....
thanks in advance...
 
You're going to need to ask specific questions in order to get help, I
think. We'll need to see your code.
 
jeremiah johnson said:
You're going to need to ask specific questions in order to get help, I
think. We'll need to see your code.


ok then...
i just want to ask for some tips on what to do regarding this matter...
as for the source code, i do not think i could, the project is a bit
classified...

but i just would like to ask if you guys had encountered this one...
when i try to debug the program, that is by pressing F5 in the IDE, the
program works very fine and runs without throwing any exception...

as we know the IDE would create the equivalent executable file in the
Debug folder of the working folder right...?
when i try to run that executable file, it runs smoothly but throws some
exceptions which had been filtered already...
i can see the executable catches some errors when it shouldnt have...

please help... give me some tips on what to do with this...

acem-tracernet
software devt staff

C# programmer
 
tracernet_v2 said:
fellow c# programmers...

i need some help....
i have created a program, a module that is part of another bigger
program...
when i debug it, by pressing F5 in the IDE, it runs so well i can
hardly wait to show it to my project leader...
but when i try to run the executable created by the IDE, the .exe file
in the Debug folder, it catches exceptions and stops the program..

As ever, if you've got exceptions you don't understand, it would really
help if you could at least tell us what those exceptions are.
 
Jon Skeet said:
As ever, if you've got exceptions you don't understand, it would really
help if you could at least tell us what those exceptions are.

actually, i have understood the exceptions, i had even trapped them....
but my real problem is that the executable catches exceptions(i had
trapped before) and end immaturely....
it bugs me because when i try debugging the program while it is in
development stage, that is when i press F5 in the IDE, the program runs
smoothly without any exception to immaturely end it...
 
tracernet_v2 said:
actually, i have understood the exceptions, i had even trapped them....
but my real problem is that the executable catches exceptions(i had
trapped before) and end immaturely....
it bugs me because when i try debugging the program while it is in
development stage, that is when i press F5 in the IDE, the program runs
smoothly without any exception to immaturely end it...

That doesn't really help us to pin down what's wrong though, does it?
Effectively, you've just given us:

"My program works in the debugger but doesn't work outside the
debugger."

Can you see how that makes it rather difficult to help you without any
more information?
 
Jon Skeet said:
tracernet_v2 <[email protected]> wrote:
That doesn't really help us to pin down what's wrong though, does it?
Effectively, you've just given us:

"My program works in the debugger but doesn't work outside the
debugger."

Can you see how that makes it rather difficult to help you without any
more information?

yes... yes... that is it!!!!
that is my problem...
My program works in the debugger but doesn't work outside the
debugger...
can you help me? can you give me some tips on how to deal with this
problem????

thanks so much in advance....
 
tracernet_v2 said:
yes... yes... that is it!!!!
that is my problem...

Yes, and the problem *we've* got is that that's just not nearly enough
information.

What would you do if a developer said to *you*: "My program doesn't
work. What's wrong?"
My program works in the debugger but doesn't work outside the
debugger...
can you help me? can you give me some tips on how to deal with this
problem????

I suggest you start cutting down your program until you've got a short
but complete program which demonstrates the problem. That program will
almost certainly not need to have anything confidential in it, which
means you'll be able to post it here, if you haven't already found the
answer by going through the exercise in the first place.

See http://www.pobox.com/~skeet/csharp/complete.html
 
ok...
thanks for the suggestion...
i will try to do that...

but any way, my problem is very similar to that one...
my program works well in the debugger, but it doesnt work outside the
debugger...
so for now i would like to ask if you have gone through that one, and
what did you do.. did you do something to the properties or any thing
around the debugger...?

just want to know....
 
Tim Haughton said:
Ignore the debugger, you can't ship your IDE with the product. Write your
unity tests and run them against the release executable. They will help you
find your problem. Things in .Net are rarely mystical. You'll be doing
something wrong.


i am new to this words, so could you please explain to me this phrases:

"Write your unity tests and run them against the release executable. "

"Things in .Net are rarely mystical. You'll be doing something wrong."

hope you could enlighten me with these....
 
tracernet_v2 said:
ok...
thanks for the suggestion...
i will try to do that...

but any way, my problem is very similar to that one...
my program works well in the debugger, but it doesnt work outside the
debugger...
so for now i would like to ask if you have gone through that one, and
what did you do.. did you do something to the properties or any thing
around the debugger...?

There are *lots* of different reasons why it might be happening - but
without any more information from you, we just won't be able to help
you any further. Can't you at least tell us what the exception is?

Jon
 
Jon Skeet said:
There are *lots* of different reasons why it might be happening - but
without any more information from you, we just won't be able to help
you any further. Can't you at least tell us what the exception is?

Jon

ok... here it is...

the first exception said that "Input string is in invalid format."

the next one said that it "cannot find the file <file name>", a file
that is existing all along....

the other one said that it "cannot proceed because the file <file name>
is used by another process"

please keep in mind that these exceptions occur outside the
debugger/IDE, that when i run the executable file itself these
exceptions occur, and the program works will with the debugger...

i am using Visual Studio 2003 IDE....
 
ok... here it is...

Finally, some information!
the first exception said that "Input string is in invalid format."

At which point? What input string? Is this a problem you've fixed?
the next one said that it "cannot find the file <file name>", a file
that is existing all along....

How are you referring to it? The working directory of the process
may well be different when running in a debugger...
the other one said that it "cannot proceed because the file <file name>
is used by another process"

That sounds like you may not be disposing of FileStreams (and the like)
properly - the debugger may be garbage collecting earlier than when you
run it outside the debugger.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top