I have a pro1.exe program that reads from the input file, calculates the result and writes it to the output file. Now I am writing a test.exe program that checks it on different tests (it fills in the input, runs pro1 using Process.Start() and compares the output with the intended one)
The problem is this: after executing pro1.exe output file is empty. However, if I run it manually, it writes the output file.
Here is the 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 - full path to the exe file.
In debugging, I see that the process starts and ends without errors.
source share