I have program pro1.exe
that reads from input file, calculates result and writes it to output file.
Now I'm writing program test.exe
, that tests it on different tests (fill input, run pro1 using Process.Start()
and compares output with supposed)
Problem is following: after executing pro1.exe
output file is empty. However, if I run it manually, it writes to output file.
Here is code how I execute pro1:
ProcessStartInfo processInfo = new ProcessStartInfo();
processInfo.FileName = _applicationName;
processInfo.ErrorDialog = true;
processInfo.UseShellExecute = false;
processInfo.RedirectStandardOutput = true;
processInfo.RedirectStandardError = true;
Process proc = Process.Start(processInfo);
_applicationName
is a full path to exe file.
in debug I see, that process is starting, and ending without errors.