我正在致力于Compact Framework 2.0项目,并且正在尝试使用Process在另一个程序“A”中启动程序“B”。开始。我以前做过几次,但这次我遇到了一些奇怪的问题。使用System.Diagnostics.Process.Start运行程序会导致MissingMethodException
程序“B”确实启动,但它会导致MissingMethodException,基本上告诉我它缺少它引用的某个程序集。问题是程序集.dll就在那里,与程序“B”在同一个文件夹中。如果我双击程序“B”,它将正确运行且没有MissingMethodException,只有在程序“A”中的Process.Start启动时才会发生此问题。我完全不知道这里发生了什么。我试图设置WorkingDirectory属性没有运气。有关为什么程序在通过Process.Start执行时无法加载其引用的任何想法?由于
System.Diagnostics.Process proc = new System.Diagnostics.Process();
ProcessStartInfo startInfo = new ProcessStartInfo(programBFullPath, "argument");
//I've been changing these two properties, have tried shell execute with both false and true, tried setting working directory and not setting it also
startInfo.UseShellExecute = false;
startInfo.WorkingDirectory = programBDirectory;
proc.StartInfo = startInfo;
proc.Start();
编辑我只是想的东西......这两个程序“A”和节目“B”使用的.dll程序“B”没有加载。如果两个程序无法同时加载相同的.dll,那就是问题所在。是这样吗?
如果直接启动B程序会发生什么?我的意思是双击它.. 编辑:对不起,我错过了问题中的一些行:D – munissor 2010-08-18 15:28:34