473,326 Members | 2,813 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,326 software developers and data experts.

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

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

Apr 2 '07 #1
4 5602
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

<li********@faa.govwrote in message
news:11**********************@p15g2000hsd.googlegr oups.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

Apr 2 '07 #2
maths algorithm .... hmmmmmmm
what has changed in couple of weeks ..... hmmmmmmmm
is it new law for daylight saving ..... hmmmmmmm

<li********@faa.govwrote in message
news:11**********************@p15g2000hsd.googlegr oups.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

Apr 2 '07 #3
On Apr 2, 4:52 pm, linda.c...@faa.gov wrote:
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

Apr 3 '07 #4
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
<li********@faa.govwrote in message
news:11**********************@p15g2000hsd.googlegr oups.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

Apr 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: angelag | last post by:
I am currently taking a college course in Visual Basic.Net and I am a beginner. I bought Visual Studio.Net 2003 to do my homework at home. I built my first project and e-mailed it to myself at...
1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
1
by: Venkat | last post by:
I just installed Visual Studio.Net 2003 and that is supposed to add that asp.net 1.1 extension. I got an error message while opening ASP.NET project.Error is : "visual studio.net has...
5
by: Dafna | last post by:
while trying to open an Asp .Net application ' I get the following message (the IIS on my computer is running) "Visual Studio .Net has detected that the specified web server is not running ASP...
1
by: soulis | last post by:
I usually compile my .CPP programs with Visual Studio C++ 6.0 and MFC. Why is the produced executable file so big? For example, the original file is 1k and the executable is 500K. Am I doing...
3
by: Rob Nicholson | last post by:
How do you determine if a program is running in the Visual Studio IDE/debugger as opposed to standalone? We often include support files in the same folder as the executable and would so something...
3
by: rohan_from_mars | last post by:
I changed my solution name to a new name, but still visual studio 2003 builds the executable with the old solution name. Also, I am unable to change the name from Project properties dialog box....
1
by: dburkinshaw | last post by:
I have a strange issue here. I created an exe that calls a Web Service that I also created. When I run in debug mode the WS is called and does its thing. When I run in release mode (through Visual...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.