因此,我们需要在我们的.net API中执行一个exe,并且这个exe是在我们的管道中与API本身同时构建的。
该exe与我们的.NET API和ddl位于完全相同的目录中。
我使用下面的代码尝试并触发exe:
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "customProgram.exe";
process.StartInfo.Arguments = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
process.Start();
process.WaitForExit();这会引发一个错误:
An error occurred trying to start process 'customProgram.exe' with working directory '/app'. No such file or directory发布于 2022-08-01 13:40:49
尝试指定文件的完整路径。例如,在这里:
Process.Start(@"C:\Program Files\Google\Chrome\Application\chrome");https://stackoverflow.com/questions/73194066
复制相似问题