Redirects Console.Error to the specified TextWriter. By default, Console.Error is set to the system's standard error stream.
[Visual Basic] Public Shared Sub SetError( _ ByVal newError As TextWriter _ ) [C#] public static void SetError( TextWriter newError ); [C++] public: static void SetError( TextWriter* newError ); [JScript] public static function SetError( newError : TextWriter );
Exception Type | Condition |
---|---|
ArgumentException | newError is null. |
SecurityException | The caller does not have to set the standard error stream. |
A StreamWriter that encapsulates a FileStream can be used to send error messages to a file.
NGWS Runtime Security:
SecurityPermission | Unmanaged code permission. |