我正在尝试以下操作:
1) 从另一个可执行文件运行c#可执行文件。
我正在使用.net Core3.1
Error =>No such file or directory
Exception encountered => System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean
redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean
setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32&
stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal,
Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at ConsoleMQTT_Sender.ProcessClass.LaunchProcess(....) in ...
该应用程序是通过运行在linux环境中的jenkins生成的。
这是跨平台问题吗?
还是许可问题?
dotnet firstexecutable.dll--secondexecutablepath“/opt/publish/xyz.dll”
dotnet firstexecutable.dll--secondexecutablepath“dotnet/opt/publish/xyz.dll”
两者都有相同的例外
process.EnableRaisingEvents = true;
process.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(process_OutputDataReceived);
process.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(process_ErrorDataReceived);
process.StartInfo.FileName = firstexecutablepath;
process.StartInfo.Arguments = "--secondexecutablepath \"" + executablepath + "\"";
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
process.WaitForExit();