没有完全理解你的项目是如何组织的,你尝试运行它的方式,我建议的原因可能是“TEST.EXE”不是的当前文件夹正在运行应用
在这种情况下,我做如下:
的情况下,1)我知道完整路径的文件,我指定:
string exePath = Path.GetFullPath("C:\test.exe");
Process.Start(exePath);
2)如果我知道文件是在同一文件夹中调用程序集DLL,我不喜欢这样(在vb.net为例):
Public Shared Function GetMyPath() As String
' SomeYourType is any class from your assembly, you can f.e. create a private class with single purpose of being used by this function
Dim installPath = Path.GetDirectoryName(Assembly.GetAssembly(GetType(SomeYourType)).CodeBase)
Return installPath.Substring(6)
End Function
然后我用这样的:
string exePath = Path.Combine(GetMyPath(), "test.exe");
Process.Start(exePath);
谢谢!有用! – James
很高兴我能帮到你) – Rustam