PiousVenom
PiousVenom

Reputation: 6908

Program works on dev machine, but won't start on test machine

I've been writing this program for a while now, and I'm finally ready to start testing it. It works 100% on my dev machine, but I wanted to try it on a machine it's never run on. So, I get my program over to a test computer. When I double-click the exe, nothing happened. I opened up task manager, and tried again. I saw the process start, but after about 5 seconds, it disappeared. No errors, no exceptions, no nothing. How would I go about trying to figure out what is going wrong? I'm still fairly new, and I've never had this happen. Thanks for any and all help!

EDIT

Sorry for not mentioning before. This is a winforms application.

EDIT 2

So, turned out what was going on is that I was trying to a dll meant for 64-bit OS into a 32-bit OS. In Windows XP, this threw a BadImageFormatException. However, in Windows 7, as I stated, it threw no exception at all.

Upvotes: 0

Views: 326

Answers (3)

KeithS
KeithS

Reputation: 71565

This is a pickle, no doubt about it. I've had to debug this type of thing before.

The first bit of useful information is that no exception is being thrown out. This tells me that somewhere in your actual code is the key to solving the problem. You are either trapping an exception and closing silently, or your code is hitting what it considers to be a "normal" exit condition and is closing in what it would consider the normal way.

To figure out where and why it's exiting, I would add debug logging at key points in your application, and attach a listener to the Debug/Trace listener collection that writes out to a file. "Key points" are places where the application is supposed to exit (or the main form of the window is supposed to close), and within any "catch" block or error event handler. Run this new version on the test computer and see what it gives you. That should tell you the basic flow of the program behind the scenes, and through what mechanism it's shutting down.

Upvotes: 1

Josh C.
Josh C.

Reputation: 4363

Have you checked the application event log?

Do you have the necessary version(s) of .Net installed?

Perhaps you should put more exception handling with calls to MessageBox.Show("I failed here") through out your application.

Upvotes: 0

Soturi
Soturi

Reputation: 1496

If you're running a console application, it is possible that it runs and then closes itself. Trying opening a command prompt, and then executing the application from there. If your program has output, then you would see it in that command window.

Upvotes: 0

Related Questions