我在c#中通过dotnet运行了bat文件如下
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "d://s.bat";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
它在通过 dotnet ide 运行时工作正常。
但我的问题是,当我通过 IIS 发布后运行上述代码时,它会返回错误为
StandardOut-has-not-been-redirected-或-the-process-hasn-t-started-yet。
你能给我一些指导方针来解决这个问题吗?