Gets a message that describes the current exception.
Assembly: mscorlib (in mscorlib.dll)
Error messages target the developer who is handling the exception. The text of theproperty 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.
Do not disclose sensitive information in exception messages without checking for the appropriate permissions.
The value of the ToString.The 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.property is included in the information returned by
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 ofto the property argument that you set or get, use "value" as the name of the property argument.
Notes to Inheritors:
Theproperty 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.
The error message should be localized.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1