Export (0) Print
Expand All

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.

AbstractionDescription
AssemblyBuilderA class that defines and represents a dynamic assembly. Inherits from the Assembly class.
ConstructorBuilderA class that defines and represents a constructor, which describes an operation that creates an instance of a type. Inherits from the ConstructorInfo class.
CustomAttributeBuilderA class that helps define custom attributes.
EnumBuilderA class that helps define and represent an enumeration type. Inherits from the Type class.
EventBuilderA 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.
FieldBuilderA 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.
ILGeneratorA 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.
LabelA class that is an opaque representation of a label used by the ILGenerator class. Labels correspond to specific locations in the MSIL code.
LocalBuilderA class that represents a local variable declared within the body of a method.
MethodBuilderA 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.
ModuleBuilderA 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.

ParameterBuilderA 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.
PropertyBuilderA 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.
TypeBuilderA 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

Emitting Dynamic Assemblies | Assemblies

Show:
© 2014 Microsoft