StandardOutput.ReadToEnd() hangs [duplicate]

Proposed solutions with BeginOutputReadLine() are a good way but in situations such as that, it is not applicable, because process (certainly with using WaitForExit()) exits earlier than async output finished completely. So, I tried to implement it synchronously and found that the solution is in using Peek() method from StreamReader class. I added check for … Read more