项目部署到iis后process无法找到文件
下面是代码:
string sArguments = Server.MapPath("/") +"11.py";
sArguments += " valid_q";
Process p = new Process();
string path = sArguments;//待处理python文件的路径,本例中放在debug文件夹下
p.StartInfo.FileName = Server.MapPath("/")+"Python25/python.exe"; //python2.7的安装路径
p.StartInfo.Arguments = sArguments;//python命令的参数
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();//启动进程
strpublishinfo = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
本地调试可以正常运行,发布到本地IIS后提示找不到文件,IISuser权限已经赋予了。