FieldInfoGetRawConstantValue Method |
Returns a literal value associated with the field by a compiler.
Namespace: System.ReflectionAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual Object GetRawConstantValue()
Return Value
Type:
ObjectAn
Object that contains the literal value associated with the field. If the literal value is a class type with an element value of zero, the return value is null.
Exceptions Exception | Condition |
---|
InvalidOperationException | The Constant table in unmanaged metadata does not contain a constant value for the current field. |
FormatException | The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the ECMA Partition II specification Metadata Logical Format: Other Structures, Element Types used in Signatures. |
NotSupportedException | The constant value for the field is not set. |
See Also