System.Console.SetError Method

Sets the Console.Error property to the specified System.IO.TextWriter object.

Syntax

public static void SetError (System.IO.TextWriter newError)

Parameters

newError
A stream that is the new standard error output.

Exceptions

TypeReason
System.Security.SecurityExceptionThe caller does not have the required permission.
ArgumentNullException newError is null.

Remarks

By default, the Console.Error property is set to the standard error output stream.

A System.IO.StreamWriter that encapsulates a System.IO.FileStream can be used to send error messages to a file.

Permissions

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0