// This won't work: Process proc = new Process(); string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase); proc.StartInfo.Filename = System.IO.Path.Combine(path, "myApp.exe"); proc.Start(); proc.WaitForExit(); // <-- Will crash here // This does work: Process proc = new Process(); proc.StartInfo.Filename = "myApp.exe"; proc.Start(); proc.WaitForExit();
Both samples will start myApp.exe just fine, but the first one seems to have some problems with Windows. Cost me four precious hours of my life.
btw, can anyone tell me why “new” in the code snippet above links to a google search for new and msdn.microsoft.com? No? That figures.

