System.Reflection.Emit.FieldBuilder Class

Defines and represents a field. This class cannot be inherited.

See Also: FieldBuilder Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComDefaultInterface(typeof(System.Runtime.InteropServices._FieldBuilder))]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class FieldBuilder : System.Reflection.FieldInfo, System.Runtime.InteropServices._FieldBuilder

Remarks

Get an instance of FieldBuilder by calling TypeBuilder.DefineField(string, Type, System.Reflection.FieldAttributes), ModuleBuilder.DefineInitializedData(string, Byte[], System.Reflection.FieldAttributes), or ModuleBuilder.DefineUninitializedData(string, int, System.Reflection.FieldAttributes).

Note:

The FieldBuilder.SetValue(object, object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Globalization.CultureInfo) method is currently not supported. As a workaround, retrieve the System.Reflection.FieldInfo by reflecting on the finished type and call System.Reflection.FieldInfo.SetValue(object, object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Globalization.CultureInfo) to set the value of the field.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0