C
C#2y ago
Zetax

❔ StandartOutput of process suddenly stops

Hey there, I've been stuck on this problem for about an hour and have tried googling etc, but just could not get it to work correctly. I am trying to read the standart output of a process after starting it from the C# program, and it reads it for sometimes 1-5 lines and then it just stops, but it's always a small random amount of lines it reads and I have no idea why it just suddenly stops. This is my code: https://gist.github.com/Finninn/c38c73bac626b4cc0c340488a205fb2b and this is what it looks like when starting: https://cdn.zetax.dev/DQ37N9bd60IQ I really hope someone here can help me as this is really frustrating :/
2 Replies
hengi
hengi2y ago
The problem seems to be with StandardOutput.EndOfStream. There's a StackOverflow issue with the same problem: https://stackoverflow.com/questions/2767496/standardoutput-endofstream-hangs the solution is to use BeginOutputReadLine() and the associated EventHandler instead of the loop.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server