Make certain that async stdout streams are fully read with

This commit is contained in:
Caelan Sayler
2024-08-08 20:29:56 +01:00
parent 240f3ed54e
commit 408772272b

View File

@@ -133,6 +133,9 @@ public static class Exe
process.Kill();
ct.ThrowIfCancellationRequested();
}
// need to call this once more to wait for the streams to finish. if WaitForExit is called with a timeout, the streams will not be fully read.
process.WaitForExit();
return (process.ExitCode, sOut.ToString().Trim(), sErr.ToString().Trim());
}