Hello,
Am writing code using VB.net 2005 and am attempting to launch a 3rd party console application and capture stdout and stderr strings. Am able to do this but I find that if I want to capture both stdout and stderr strings I have to wait for the process to terminate before I can retrieve any output data. If I remove the stderr read I can capture the stdout data as its being emitted. Thus it appears that the stderr read "blocks" reading of stdout.
p.start
dim std_out as StreamReader = p.StandardOutput
dim std_err as StreamReader = p.StandardError
Do while DoneWithProcess = False
debug.Writeline(std_out.ReadLine)
debug.Writeline(std_err.ReadLine)
Loop
' Note that the flag DoneWithProcess is set in an event handler
Does anyone have any suggestions on how to "un block" the reading of the stderr strings?
Thanks,
bartj
Am writing code using VB.net 2005 and am attempting to launch a 3rd party console application and capture stdout and stderr strings. Am able to do this but I find that if I want to capture both stdout and stderr strings I have to wait for the process to terminate before I can retrieve any output data. If I remove the stderr read I can capture the stdout data as its being emitted. Thus it appears that the stderr read "blocks" reading of stdout.
p.start
dim std_out as StreamReader = p.StandardOutput
dim std_err as StreamReader = p.StandardError
Do while DoneWithProcess = False
debug.Writeline(std_out.ReadLine)
debug.Writeline(std_err.ReadLine)
Loop
' Note that the flag DoneWithProcess is set in an event handler
Does anyone have any suggestions on how to "un block" the reading of the stderr strings?
Thanks,
bartj