Starting impersonated R.exe from .Net Core... Application error

0

I'm trying to run an impersonated R-Session from .net Core. Here is the code i'm running:

            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();

When the Code is getting executed everthing seems fine, but after about 20 seconds the R.exe exits and the Eventlog writes out an Applicationerror (0xc0000142).

When I tested it on my local client everything works fine. But after the deployment to the server, I got the described behaviour.

My local client runs Win10 x64

The remote server runs Windows Server 2016

c#
.net
r
iis
.net-core
asked on Stack Overflow Apr 19, 2018 by Sascha K • edited Apr 19, 2018 by Sascha K

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0