C# process hanging due to StandardOutput.ReadToEnd() and StandardError.ReadToEnd() [duplicate]
问题 This question already has answers here : ProcessStartInfo hanging on “WaitForExit”? Why? (22 answers) Hanging process when run with .NET Process.Start — what's wrong? (5 answers) Closed 2 years ago . For processes with a lot of output or error, trying to redirect standard output and error with a simple string output = process.StandardOutput.ReadToEnd(); string err = process.StandardError.ReadToEnd(); process.WaitForExit(); will cause the program to hang, and never actually finish. 回答1: As it