Home All Groups Group Topic Archive Search About

C# code works if running from Visual studio, but not from executable file?

Author
2 Apr 2007 2:52 PM
linda.chen
Greeting.

We have a 6 year old application, which contains both managed (C#) and
unmanaged code (C++). For all the new components we try to create them
in C#. We  build all projects (both C++ and C# code) into a solution
from visual studio .net 2003.

In out solution we have a project implementing a pretty complicated
math algorithm. This component usally work very well. But in a couple
weeks ago,  a user found a case that our algorithm did not work
correctly.

We are trying to debug the problem. The odd thing is: when we run the
application from visual studio, it works from both debug and release
mode. But if we run it from the executable file directly (double click
on the exe file from the output folder), the application stop working
for that case.

Any idea what caused this problem? How do we debug our code in this
case? We have run out of the ideas.

Linda

Author
2 Apr 2007 4:43 PM
Kevin Spencer
Can you define what you mean by "works," "work," and "stop working?" In
other words, what is the expected behavior? What is the behavior when you
are debugging? What is the behavior when you are not debugging? Also, is the
error occurring in the C# modules or the C++ modules?

Meanwhile, just a shot in the dark: See if there are any preprocessor
statements that affect the behavior of the app when debugging, as in

#if debug

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

<linda.c***@faa.gov> wrote in message
Show quote
news:1175525528.968175.102460@p15g2000hsd.googlegroups.com...
> Greeting.
>
> We have a 6 year old application, which contains both managed (C#) and
> unmanaged code (C++). For all the new components we try to create them
> in C#. We  build all projects (both C++ and C# code) into a solution
> from visual studio .net 2003.
>
> In out solution we have a project implementing a pretty complicated
> math algorithm. This component usally work very well. But in a couple
> weeks ago,  a user found a case that our algorithm did not work
> correctly.
>
> We are trying to debug the problem. The odd thing is: when we run the
> application from visual studio, it works from both debug and release
> mode. But if we run it from the executable file directly (double click
> on the exe file from the output folder), the application stop working
> for that case.
>
> Any idea what caused this problem? How do we debug our code in this
> case? We have run out of the ideas.
>
> Linda
>
Author
2 Apr 2007 5:03 PM
Mubashir Khan
maths algorithm .... hmmmmmmm
what has changed in couple of weeks ..... hmmmmmmmm
is it new law for daylight saving ..... hmmmmmmm

<linda.c***@faa.gov> wrote in message
Show quote
news:1175525528.968175.102460@p15g2000hsd.googlegroups.com...
> Greeting.
>
> We have a 6 year old application, which contains both managed (C#) and
> unmanaged code (C++). For all the new components we try to create them
> in C#. We  build all projects (both C++ and C# code) into a solution
> from visual studio .net 2003.
>
> In out solution we have a project implementing a pretty complicated
> math algorithm. This component usally work very well. But in a couple
> weeks ago,  a user found a case that our algorithm did not work
> correctly.
>
> We are trying to debug the problem. The odd thing is: when we run the
> application from visual studio, it works from both debug and release
> mode. But if we run it from the executable file directly (double click
> on the exe file from the output folder), the application stop working
> for that case.
>
> Any idea what caused this problem? How do we debug our code in this
> case? We have run out of the ideas.
>
> Linda
>
Author
3 Apr 2007 11:21 AM
oscar.acostamontesde@googlemail.com
On Apr 2, 4:52 pm, linda.c***@faa.gov wrote:
Show quote
> Greeting.
>
> We have a 6 year old application, which contains both managed (C#) and
> unmanaged code (C++). For all the new components we try to create them
> in C#. We  build all projects (both C++ and C# code) into a solution
> from visual studio .net 2003.
>
> In out solution we have a project implementing a pretty complicated
> math algorithm. This component usally work very well. But in a couple
> weeks ago,  a user found a case that our algorithm did not work
> correctly.
>
> We are trying to debug the problem. The odd thing is: when we run the
> application from visual studio, it works from both debug and release
> mode. But if we run it from the executable file directly (double click
> on the exe file from the output folder), the application stop working
> for that case.
>
> Any idea what caused this problem? How do we debug our code in this
> case? We have run out of the ideas.
>
> Linda

Hello Linda:
Have you tryed to do some loggin in your app? Try writing some
instrumentation code to a file and see the results after execution.
Best regards.
Oscar Acosta
Author
4 Apr 2007 1:26 PM
Ron Allen
Linda,
    Have you checked to make sure all variables are being properly
initialized?  Sometimes the development environment will set things to 0 to
start with that will be set to a random value outside the environment if not
initialized.

Ron Allen
<linda.c***@faa.gov> wrote in message
Show quote
news:1175525528.968175.102460@p15g2000hsd.googlegroups.com...
> Greeting.
>
> We have a 6 year old application, which contains both managed (C#) and
> unmanaged code (C++). For all the new components we try to create them
> in C#. We  build all projects (both C++ and C# code) into a solution
> from visual studio .net 2003.
>
> In out solution we have a project implementing a pretty complicated
> math algorithm. This component usally work very well. But in a couple
> weeks ago,  a user found a case that our algorithm did not work
> correctly.
>
> We are trying to debug the problem. The odd thing is: when we run the
> application from visual studio, it works from both debug and release
> mode. But if we run it from the executable file directly (double click
> on the exe file from the output folder), the application stop working
> for that case.
>
> Any idea what caused this problem? How do we debug our code in this
> case? We have run out of the ideas.
>
> Linda
>

AddThis Social Bookmark Button