Property Value

Implements

Error messages target the developer who is handling the exception. The text of the Message property should completely describe the error and, when possible, should also explain how to correct the error. Top-level exception handlers may display the message to end-users, so you should ensure that it is grammatically correct and that each sentence of the message ends with a period. Do not use question marks or exclamation points. If your application uses localized exception messages, you should ensure that they are accurately translated.

Security Note

Do not disclose sensitive information in exception messages without checking for the appropriate permissions.

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.

Windows Runtime and .NET Framework 4.5.1

Starting with the .NET Framework 4.5.1 and Windows 8.1, the fidelity of error messages from exceptions that are propagated from Windows Runtime types and members that are not part of the .NET Framework is improved. In particular, exception messages from Visual C++ component extensions (C++/CX) are now propagated back into .NET Framework Exception objects.

Notes to Implementers

If you throw an exception from a property, and you need to refer in the text of Message to the property argument that you set or get, use "value" as the name of the property argument.

Notes to Inheritors

The Message property is overridden in classes that require control over message content or format. Application code typically accesses this property when it needs to display information about an exception that has been caught.