Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program runs in VS but not on it's own

Status
Not open for further replies.

iwease

IS-IT--Management
Sep 4, 2006
104
0
0
CA
Hi,

I've written a program and it runs great when I run it in debug mode from visual studio 2003 (by pressing F5). However, when I go to the debug directory and open the program through the exe generated there, the program has bugs...it runs, but has bugs.

So, my program is reference multiple dlls that have been made by other people in our company. Is the version running from the debug directory somehow referencing older dlls then the one run from pressing F5? When I look at the date modified in the debug directory, the dll's appear to be the most recent version.

Any ideas?
 
Make sure you are pointing to a correct debug directory. I mean when you build, it will create an exe at certain location, which is the debug directory location that is configurable from the IDE. Make sure that exe has the latest modified date.

Malay
 
Don't you just love DLLs?

I had a very similar problem not long ago. I ended up recompiling without reference to the dlls and then re-adding them but that can be very hard work if those dlls are used in a lot of places.

It seems to be an issue of the resource referencing.

If your code has bugs, you might want to consider putting a giant try catch around your Main() method and providing a messagebox when it crashes.

try
{
Application.Run(new Form1());
}
catch( Exception ex )
{
MessageBox.Show(ex.Message);
}

I wouldn't release it to production that way though :)
 
Ok, I'm completely stumped. I rechecked all the path settings and references and have only included what is absolutely necessary. When I compile, all the date modifieds for the 5 projects are updated.

About using the try catch, the bugs aren't actual errors in the program. They are bugs in the behavior and can't be picked up by a try/catch block.


Any other ideas?
 
This is the situation.

The programmer works when I run it with debugging (F5), and it doesn't work when I run it without debugging (ctrl + F5)
 
Some futher information. The following code generates a message box with text output from fc.exe when I run it in debug mode. It just gives a blank message when I run it without debugging. I am preforming the same behavior leading up to the code in both cases

System.Diagnostics.ProcessStartInfo sinf = new System.Diagnostics.ProcessStartInfo( "fc.exe", "\""+openFileDialog1.FileName+"\" \""+tempLocation+"\"");
sinf.RedirectStandardOutput = true;
sinf.UseShellExecute = false;
sinf.CreateNoWindow = true;
System.Diagnostics.Process p = new System.Diagnostics.Process ();
p.StartInfo = sinf;
p.Start ();
string res = p.StandardOutput.ReadToEnd ();
MessageBox.Show (res);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top