我正在尝试从.net Core运行模拟的R-Session。这是我正在运行的代码:
info.WorkingDirectory = @"C:\r_installs\R-3.3.2\bin\x64";
info.FileName = @"C:\r_installs\R-3.3.2\bin\x64\R.exe";
info.Arguments = $"--vanilla";
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
info.UseShellExecute = false;
info.CreateNoWindow = true;
info.ErrorDialog = true;
info.Domain = _Cred.Domain;
info.UserName = _Cred.UserName;
info.Password = _Cred.PwdSecure;
var proc = new Process();
proc.OutputDataReceived += new DataReceivedEventHandler(ReadAsyncOutput);
proc.ErrorDataReceived += new DataReceivedEventHandler(ReadAsyncOutput);
proc.StartInfo = info;
proc.Start();
proc.WaitForExit();
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
当代码被执行时,everthing看起来很好,但是大约20秒后R.exe退出并且Eventlog写出了一个Applicationerror(0xc0000142)。
当我在本地客户端测试时,一切正常。但是在部署到服务器之后,我得到了描述的行为。
我的本地客户端运行Win10 x64
远程服务器运行Windows Server 2016