473,783 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5625
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.goo glegroups.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.goo glegroups.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.goo glegroups.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
7269
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 school. When I tried to open it in the lab, I got a message saying I couldn't open it because it was created with a newer version. Evidently the lab is using Visual Studio.Net 2002. My professor doesn't just want the executable file, he wants...
1
3921
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 make it easier for someone (i.e. a Microsoft person) to digest the information and respond to it. I am a C++ and Java developer with over 3 years of industry experience. I've written low level C++ code, in addition to web clients that use web...
1
1911
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 detected that the specified web server is not running ASP.net version 1.1. You will be
5
1747
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 .NET version 1.1 you will be unable to run ASP .NET web applications or services" what can cause this error message? Thanks,
1
1800
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 osmething wrong? Thank you! soulis
3
2770
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 like: Dim SupportFile As String SupportFile = Application.StartupPath & "\SupportFile.txt" But of course this fails when running in the IDE as the executable is in the BIN folder so we need to do something like this:
3
2599
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. The text box which has the name is uneditable. How to change it?
1
1343
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 Studio) the WS is called and does its thing. I then created the install for the project, installed it and ran it. The WS gets called only if Visual Studio is running. Why would this be? The executable is in release mode and has the config file...
1
8145
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 file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but when not running, it is. Just an idea for you to think about. Another option would possibly be to...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.