System.Reflection.Emit.ModuleBuilder.DefineInitializedData Method

Defines an initialized data field in the .sdata section of the portable executable (PE) file.

Syntax

public FieldBuilder DefineInitializedData (string name, byte[] data, System.Reflection.FieldAttributes attributes)

Parameters

name
The name used to refer to the data. name cannot contain embedded nulls.
data
The binary large object (BLOB) of data.
attributes
The attributes for the field. The default is Static.

Returns

A field to reference the data.

Remarks

System.Reflection.FieldAttributes.Static is automatically included in attributes.

The data defined by this method is not created until the ModuleBuilder.CreateGlobalFunctions method is called.

Note:

Starting with the net_v20sp1_long, this member no longer requires System.Security.Permissions.ReflectionPermission with the System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

Requirements

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