Returns a literal value associated with the property by a compiler.
Assembly: mscorlib (in mscorlib.dll)
The Constant table in unmanaged metadata does not contain a constant value for the current property.
The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the Standard ECMA-335 - Common Language Infrastructure (CLI) specification, Partition II.
This method is provided for designers of managed compilers and code analyzers.
Do not use this method in the reflection-only context, because it might cause code to execute. Use the GetRawConstantValue method instead.
In unmanaged metadata, the Constant table is used to store constant values for fields, parameters, and properties. Constant information does not directly influence runtime behavior. Compilers inspect this information, at compile time, when importing metadata. If used, the value of a constant is embedded in the Microsoft intermediate language (MSIL) stream the compiler emits. There are no MSIL instructions that can be used to access the Constant table at run time.
For more information about constant values and the Constant table, see the ECMA Partition II documentation. The documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.