Share via


Message Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a message that describes the current exception.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property Message As String
public virtual string Message { get; }
public:
virtual property String^ Message {
    String^ get ();
}
abstract Message : string with get
override Message : string with get
function get Message () : String

Property Value

Type: System. . :: . .String
The error message that explains the reason for the exception, or an empty string("").

Remarks

The text of Message should completely describe the error and should, when possible, explain how to correct it. The value of the Message property is included in the information returned by ToString.

The Message property is set only when creating an Exception. 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.

.NET Framework Security

See Also

Reference

Exception Class

System Namespace