Click or drag to resize
FieldInfoGetRawConstantValue Method
Returns a literal value associated with the field by a compiler.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual Object GetRawConstantValue()

Return Value

Type: Object
An 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
ExceptionCondition
InvalidOperationExceptionThe Constant table in unmanaged metadata does not contain a constant value for the current field.
FormatExceptionThe 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.
NotSupportedExceptionThe constant value for the field is not set.
See Also