Mono Class Library: System.Exception Overview | Members

System.Exception.Message Property

Gets a string containing a message that describes the current Exception. [Edit]

public virtual string Message { get; }

Value

A string that contains a detailed description of the error, or string.Empty. This value is intended to be understood by humans. [Edit]

Remarks

Note:

The text of Exception.Message should completely describe the error and should, when possible, explain how to correct it.

The value of the Exception.Message property is included in the information returned by Exception.ToString .

This property is read-only.

Operation

The Exception.Message property is set only when creating an Exception instance.

If no message was supplied to the constructor for the current instance, the system supplies a default message that is formatted using the current system culture.

Note to Inheritors

The Exception.Message property is overridden in classes that require control over message content or format.

Usage

Application code typically accesses this property when there is a need to display information about an exception that has been caught.

[Edit]

Requirements

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