[Mono-list] System.Diagnostic.Process and event handlers

Robert Jordan robertj at gmx.net
Sat Jan 29 08:18:19 EST 2011

On 29.01.2011 13:28, noda wrote:
> Hi,
> I'm trying to port my .net console application on mono, and I'm experiencing
> strange problems with external Process running with event handlers.
> Here is what I'm doing:
> - creating a new System.Diagnostic.Process, to run mencoder with some
> specific parameters
> - redirecting standard output from this process :
> proc.ErrorDataReceived += new
> System.Diagnostics.DataReceivedEventHandler(proc_DataReceived);
>                  proc.OutputDataReceived += new
> System.Diagnostics.DataReceivedEventHandler(proc_DataReceived);
> - in my proc_DataReceived method, i'm doing some processing to get info and
> progress about encoding, and print a new progress info string in the
> console.

Please post more code because it's impossible to tell if this is a
Mono bug or something else, e.g. omitting the necessary
proc.Begin{Output|Error}ReadLine() calls or proc.WaitForExit().


More information about the Mono-list mailing list