Process.OutputDataReceived and ErrorDataReceived come in a different order than console messages.

D

DoB

Hi,

I am reading the process output and error streams, using:
...
p.OutputDataReceived += new
DataReceivedEventHandler(ConsoleEventHandler);
p.ErrorDataReceived += new
DataReceivedEventHandler(ConsoleEventHandler);
...

The problem is that I would like to receive these events in exactly the same
order in which they would be shown by the console if the streams were not
redirected (in other words: I would like to simulate the console).
Buth they come in a different order: generally, the error messages come
before the output messages and such result is not readable.

How to fix this? Is the StandardError buffered? If so, how to make it
unbuffered?

Regards,
DoB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top