Occurs when an application writes to its redirected StandardError stream.
Assembly: System (in System.dll)
The event indicates that the associated process has written to its redirected StandardError stream.
The event only occurs during asynchronous read operations on StandardError. To start asynchronous read operations, you must redirect the StandardError stream of a Process, add your event handler to the event, and call BeginErrorReadLine. Thereafter, the event signals each time the process writes a line to the redirected StandardError stream, until the process exits or calls CancelErrorRead.
The application that is processing the asynchronous output should call the WaitForExit() method to ensure that the output buffer has been flushed.
The following example uses the net view command to list the available network resources on a remote computer. The user supplies the target computer name as a command-line argument. The user can also supply a file name for error output. The example collects the output of the net command, waits for the process to finish, and then writes the output results to the console. If the user supplies the optional error file, the example writes errors to the file.
for full trust for the immediate caller. This member cannot be used by partially trusted code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.