Difference between F5 et running directly the debug exe

A

Antoine P.

Hello there -
I've got the following problem: my C# app (an .exe using different
dlls) has a different behaviour regarding the way I launch it.
The right behaviour when I press F5 from Visual C# Express, and the
wrong when I launch the exe file from the bin\debug directory.
What's the difference between the 2 calls ? This is the same .exe !
Are dll loaded differently ?
The difference is an object which becomes empty for an unknown reason.

Thanks!
Antoine.
 
G

garyusenet

When you run an object in debug mode (F5) objects aren't cleared by the
GC in the same way that they are when you run the release version. The
reason being that they are kept alive so you can do things like view
them in the debugger and check what there values are etc... This
probabally has a lot to do with your problem.

caveat: *i'm a complete novice, what i say may be completely wrong...*

HTH Gary.
 
D

Dustin Campbell

Hello there -
I've got the following problem: my C# app (an .exe using different
dlls) has a different behaviour regarding the way I launch it.
The right behaviour when I press F5 from Visual C# Express, and the
wrong when I launch the exe file from the bin\debug directory.
What's the difference between the 2 calls ? This is the same .exe !
Are dll loaded differently ?
The difference is an object which becomes empty for an unknown reason.

Yes, there are differences because you are running from within a debugger
when using F5. In addition, you are likely running your app inside of a Visual
Studio hosting process. So, when you press F5, things *do* run differently
when you run your app outside of Visual Studio. Normally, the debugger doesn't
cause problems but there are cases where it can be intrusive.

Are you able to isolate the problem and reproduce it in a small demo app?
If you can create a reproducible case, it'll be easier to figure out exactly
what is happening and how the debugger is interfering.

Best Regards,
Dustin Campbell
Developer Express Inc.
 
A

Antoine P.

Thanks for your answers, i'm now pretty sure this is caused by the
GC...even if 'cause' is not the right word ;) I've got a bug, I now
have to find it...
The thing which is complicating the whole stuff is that i'm using IKVM
(i'm using DevExpress components too, but this is not linked :) ), so
this is a java object which is garbage collected...i'll check with
Jeroen Frijters :)

Love IKVM, Love DevExpress

Antoine.
 

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

Top