Problems starting process programatically.

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
To answer my own query:

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