我可以通过dotnetcore的本地代码运行python脚本,但当我在本地机器上托管相同的代码时,它不会运行python脚本

我可以通过dotnetcore的本地代码运行python脚本,但当我在本地机器上托管相同的代码时,它不会运行python脚本,python,.net-core,iis-8,Python,.net Core,Iis 8,我使用的是dot net core web API,如果我在本地调试代码,它会运行python脚本。但是,当我在本地机器上托管web API时,只有python脚本不工作,其余都正常工作 var file = Configuration.GetValue<string>("DE.PythonPath"); ProcessStartInfo start = new ProcessStartInfo(); start.FileName = file;

我使用的是dot net core web API,如果我在本地调试代码,它会运行python脚本。但是,当我在本地机器上托管web API时,只有python脚本不工作,其余都正常工作

var file = Configuration.GetValue<string>("DE.PythonPath");
        ProcessStartInfo start = new ProcessStartInfo();
        start.FileName = file;
        start.Arguments = string.Format("{0} {1}", cmd, args);
        start.UseShellExecute = false;
        start.RedirectStandardOutput = true;
Process process = Process.Start(start)
StreamReader reader = process.StandardOutput
var result = reader.ReadToEnd();
                return result;
var file=Configuration.GetValue(“DE.PythonPath”);
ProcessStartInfo start=新的ProcessStartInfo();
start.FileName=文件;
start.Arguments=string.Format(“{0}{1}”,cmd,args);
start.UseShellExecute=false;
start.RedirectStandardOutput=true;
Process Process=Process.Start(开始)
StreamReader reader=process.StandardOutput
var result=reader.ReadToEnd();
返回结果;

我想通过托管代码运行python脚本。

您会遇到什么错误(如果有)?首先,您是否在本地安装了Python?基本规则是@grooveplex我在托管API中没有得到任何错误我得到状态代码200 ok,但问题是“加载响应数据失败”不response@grooveplex是的,我安装了它,这就是为什么我可以在本地运行代码,而不需要宿主。我可以调试代码。@LexLi谢谢,但它没有帮助。