Problems starting process programatically.

G

Guest

I have a boot-strap application that automatically attempts to download new
assemblies, before starting the main application.

The code we use to launch the new application (C#) is:
Process midas = new Process();
midas.StartInfo.FileName = "C:\\Program Files\\Medite\\MIDAS\\MIDAS.exe";
midas.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
midas.StartInfo.WorkingDirectory = "C:\\Program Files\\Medite\\MIDAS\\";
midas.Start();

Now; this works on the vast majority of machines, but in some instances, the
started application dies horribly with the dreaded:
[MIDAS.exe - Common Language Runtime Debugging Services]
Application has generated an exception that could not be handled.
Process id = 0x???, Thread id = 0x???
Click OK to terminate the application
Click CANCEL to debug the application
[ OK ] [ Cancel ]

However, starting the application via explorer, it works fine?
I'm running out of ideas to try -- in some instances, copying a new copy of
the Midas.exe program, and then copying the "broken" one back will make it
work.

I'm past head scratching, mainly as I've no real idea how to repoduce this
on any machine consistantly.
 
G

Guest

To answer my own query:

Changing to not use ShellExecute fixes the issue. Not sure why, but it does.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top