Reflection Emit Abstractions 

The reflection emit abstractions correspond closely to the common type system that underlies the common language runtime.

An assembly is a configured set of loadable code modules and other resources that together implement a unit of functionality. Assemblies have names that form the basis of the common type system's naming hierarchy.

This topic classifies assemblies as either static or dynamic. A static assembly is an assembly that is loaded from disk. A dynamic assembly is an assembly that is created using reflection emit. The following table shows the abstractions used by reflection emit in alphabetical order.

Abstraction Description

AssemblyBuilder

A class that defines and represents a dynamic assembly. Inherits from the Assembly class.

ConstructorBuilder

A class that defines and represents a constructor, which describes an operation that creates an instance of a type. Inherits from the ConstructorInfo class.

CustomAttributeBuilder

A class that helps define custom attributes.

DynamicMethod

A class that defines a global method that can be executed using a delegate.

EnumBuilder

A class that helps define and represent an enumeration type. Inherits from the Type class.

EventBuilder

A class that is used to define and represent an event. Inherits from the EventInfo class. Events of an object type specify named state transitions in which subscribers can register or unregister interest using accessor methods.

FieldBuilder

A class that is used to define and represent a field. Inherits from the FieldInfo class. A field is a named subdivision of a value. A type can have field members. A module or a type can also reference fields defined in the .sdata section of a portable executable (PE) file.

ILGenerator

A class that is used to define and represent Microsoft intermediate language (MSIL). The runtime just-in-time (JIT) compiler translates instructions in MSIL to native code.

Label

A class that is an opaque representation of a label used by the ILGenerator class. Labels correspond to specific locations in the MSIL code.

LocalBuilder

A class that represents a local variable declared within the body of a method.

MethodBuilder

A class that is used to define and represent a method. Inherits from the MethodInfo class. A method describes an operation that can be performed on values of a type.

ModuleBuilder

A class that is used to define and represent a module. Inherits from the Module class.

A module is a compilation unit or a development unit. A module created using the reflection emit API is called a dynamic module for the duration of the run in which the module was created. The term dynamic module does not apply if the module is saved to disk and then loaded from disk. Dynamic modules that can be saved to disk as a PE file are called persistable dynamic modules. Dynamic modules that exist only in memory are called transient dynamic modules.

ParameterBuilder

A class that is used to define and represent a parameter. Inherits from the ParameterInfo class. Parameters are locations that represent arguments of methods or constructors.

PropertyBuilder

A class that is used to define and represent a property. Inherits from the PropertyInfo class. Properties of an object type specify named values that are accessible using accessor methods that read and write the value.

TypeBuilder

A class that is used to define and represent a type. Inherits from the Type class. Types describe values. The type defines the allowable values and the allowable operations supported by the values of the type. Types can have members that are types, methods, fields, properties, or events.

See Also

Other Resources

Emitting Dynamic Methods and Assemblies
Assemblies in the Common Language Runtime