ModuleBuilder Class

ModuleBuilder Class

 

Defines and represents a module in a dynamic assembly.

Namespace:   System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Reflection.Module
    System.Reflection.Emit.ModuleBuilder

[<ClassInterfaceAttribute(ClassInterfaceType.None)>]
[<ComVisibleAttribute(true)>]
[<HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)>]
type ModuleBuilder = 
    class
        inherit Module
        interface _ModuleBuilder
    end

NameDescription
System_CAPS_pubpropertyAssembly

Gets the dynamic assembly that defined this instance of ModuleBuilder.(Overrides Module.Assembly.)

System_CAPS_pubpropertyCustomAttributes

Gets a collection that contains this module's custom attributes.(Inherited from Module.)

System_CAPS_pubpropertyFullyQualifiedName

Gets a String representing the fully qualified name and path to this module.(Overrides Module.FullyQualifiedName.)

System_CAPS_pubpropertyMDStreamVersion

Gets the metadata stream version.(Overrides Module.MDStreamVersion.)

System_CAPS_pubpropertyMetadataToken

Gets a token that identifies the current dynamic module in metadata.(Overrides Module.MetadataToken.)

System_CAPS_pubpropertyModuleHandle

Gets a handle for the module.(Inherited from Module.)

System_CAPS_pubpropertyModuleVersionId

Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.(Overrides Module.ModuleVersionId.)

System_CAPS_pubpropertyName

A string that indicates that this is an in-memory module.(Overrides Module.Name.)

System_CAPS_pubpropertyScopeName

Gets a string that represents the name of the dynamic module.(Overrides Module.ScopeName.)

NameDescription
System_CAPS_pubmethodCreateGlobalFunctions()

Completes the global function definitions and global data definitions for this dynamic module.

System_CAPS_pubmethodDefineDocument(String, Guid, Guid, Guid)

Defines a document for source.

System_CAPS_pubmethodDefineEnum(String, TypeAttributes, Type)

Defines an enumeration type that is a value type with a single non-static field called value__ of the specified type.

System_CAPS_pubmethodDefineGlobalMethod(String, MethodAttributes, CallingConventions, Type, Type[])

Defines a global method with the specified name, attributes, calling convention, return type, and parameter types.

System_CAPS_pubmethodDefineGlobalMethod(String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

Defines a global method with the specified name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.

System_CAPS_pubmethodDefineGlobalMethod(String, MethodAttributes, Type, Type[])

Defines a global method with the specified name, attributes, return type, and parameter types.

System_CAPS_pubmethodDefineInitializedData(String, Byte[], FieldAttributes)

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

System_CAPS_pubmethodDefineManifestResource(String, Stream, ResourceAttributes)

Defines a binary large object (BLOB) that represents a manifest resource to be embedded in the dynamic assembly.

System_CAPS_pubmethodDefinePInvokeMethod(String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

Defines a PInvoke method with the specified name, the name of the DLL in which the method is defined, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.

System_CAPS_pubmethodDefinePInvokeMethod(String, String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

Defines a PInvoke method with the specified name, the name of the DLL in which the method is defined, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.

System_CAPS_pubmethodDefineResource(String, String)

Defines the named managed embedded resource to be stored in this module.

System_CAPS_pubmethodDefineResource(String, String, ResourceAttributes)

Defines the named managed embedded resource with the given attributes that is to be stored in this module.

System_CAPS_pubmethodDefineType(String)

Constructs a TypeBuilder for a private type with the specified name in this module.

System_CAPS_pubmethodDefineType(String, TypeAttributes)

Constructs a TypeBuilder given the type name and the type attributes.

System_CAPS_pubmethodDefineType(String, TypeAttributes, Type)

Constructs a TypeBuilder given type name, its attributes, and the type that the defined type extends.

System_CAPS_pubmethodDefineType(String, TypeAttributes, Type, Int32)

Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the total size of the type.

System_CAPS_pubmethodDefineType(String, TypeAttributes, Type, PackingSize)

Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the packing size of the type.

System_CAPS_pubmethodDefineType(String, TypeAttributes, Type, PackingSize, Int32)

Constructs a TypeBuilder given the type name, attributes, the type that the defined type extends, the packing size of the defined type, and the total size of the defined type.

System_CAPS_pubmethodDefineType(String, TypeAttributes, Type, Type[])

Constructs a TypeBuilder given the type name, attributes, the type that the defined type extends, and the interfaces that the defined type implements.

System_CAPS_pubmethodDefineUninitializedData(String, Int32, FieldAttributes)

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

System_CAPS_pubmethodDefineUnmanagedResource(Byte[])

Defines an unmanaged embedded resource given an opaque binary large object (BLOB) of bytes.

System_CAPS_pubmethodDefineUnmanagedResource(String)

Defines an unmanaged resource given the name of Win32 resource file.

System_CAPS_pubmethodEquals(Object)

Returns a value that indicates whether this instance is equal to the specified object.(Overrides Module.Equals(Object).)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFindTypes(TypeFilter, Object)

Returns an array of classes accepted by the given filter and filter criteria.(Inherited from Module.)

System_CAPS_pubmethodGetArrayMethod(Type, String, CallingConventions, Type, Type[])

Returns the named method on an array class.

System_CAPS_pubmethodGetArrayMethodToken(Type, String, CallingConventions, Type, Type[])

Returns the token for the named method on an array class.

System_CAPS_pubmethodGetConstructorToken(ConstructorInfo)

Returns the token used to identify the specified constructor within this module.

System_CAPS_pubmethodGetConstructorToken(ConstructorInfo, IEnumerable<Type>)

Returns the token used to identify the constructor that has the specified attributes and parameter types within this module.

System_CAPS_pubmethodGetCustomAttributes(Boolean)

Returns all the custom attributes that have been applied to the current ModuleBuilder.(Overrides Module.GetCustomAttributes(Boolean).)

System_CAPS_pubmethodGetCustomAttributes(Type, Boolean)

Returns all the custom attributes that have been applied to the current ModuleBuilder, and that derive from a specified attribute type.(Overrides Module.GetCustomAttributes(Type, Boolean).)

System_CAPS_pubmethodGetCustomAttributesData()

Returns information about the attributes that have been applied to the current ModuleBuilder, expressed as CustomAttributeData objects.(Overrides Module.GetCustomAttributesData().)

System_CAPS_pubmethodGetField(String)

Returns a field having the specified name.(Inherited from Module.)

System_CAPS_pubmethodGetField(String, BindingFlags)

Returns a module-level field, defined in the .sdata region of the portable executable (PE) file, that has the specified name and binding attributes.(Overrides Module.GetField(String, BindingFlags).)

System_CAPS_pubmethodGetFields()

Returns the global fields defined on the module.(Inherited from Module.)

System_CAPS_pubmethodGetFields(BindingFlags)

Returns all fields defined in the .sdata region of the portable executable (PE) file that match the specified binding flags.(Overrides Module.GetFields(BindingFlags).)

System_CAPS_pubmethodGetFieldToken(FieldInfo)

Returns the token used to identify the specified field within this module.

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Overrides Module.GetHashCode().)

System_CAPS_pubmethodGetMethod(String)

Returns a method having the specified name.(Inherited from Module.)

System_CAPS_pubmethodGetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.(Inherited from Module.)

System_CAPS_pubmethodGetMethod(String, Type[])

Returns a method having the specified name and parameter types.(Inherited from Module.)

System_CAPS_protmethodGetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns the module-level method that matches the specified criteria.(Overrides Module.GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]).)

System_CAPS_pubmethodGetMethods()

Returns the global methods defined on the module.(Inherited from Module.)

System_CAPS_pubmethodGetMethods(BindingFlags)

Returns all the methods that have been defined at the module level for the current ModuleBuilder, and that match the specified binding flags.(Overrides Module.GetMethods(BindingFlags).)

System_CAPS_pubmethodGetMethodToken(MethodInfo)

Returns the token used to identify the specified method within this module.

System_CAPS_pubmethodGetMethodToken(MethodInfo, IEnumerable<Type>)

Returns the token used to identify the method that has the specified attributes and parameter types within this module.

System_CAPS_pubmethodGetObjectData(SerializationInfo, StreamingContext)

Provides an ISerializable implementation for serialized objects.(Inherited from Module.)

System_CAPS_pubmethodGetPEKind(PortableExecutableKinds, ImageFileMachine)

Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.(Overrides Module.GetPEKind(PortableExecutableKinds, ImageFileMachine).)

System_CAPS_pubmethodGetSignatureToken(Byte[], Int32)

Defines a token for the signature that has the specified character array and signature length.

System_CAPS_pubmethodGetSignatureToken(SignatureHelper)

Defines a token for the signature that is defined by the specified SignatureHelper.

System_CAPS_pubmethodGetSignerCertificate()

Returns an X509Certificate object corresponding to the certificate included in the Authenticode signature of the assembly which this module belongs to. If the assembly has not been Authenticode signed, null is returned.(Overrides Module.GetSignerCertificate().)

System_CAPS_pubmethodGetStringConstant(String)

Returns the token of the given string in the module’s constant pool.

System_CAPS_pubmethodGetSymWriter()

Returns the symbol writer associated with this dynamic module.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetType(String)

Gets the named type defined in the module.(Overrides Module.GetType(String).)

System_CAPS_pubmethodGetType(String, Boolean)

Gets the named type defined in the module, optionally ignoring the case of the type name.(Overrides Module.GetType(String, Boolean).)

System_CAPS_pubmethodGetType(String, Boolean, Boolean)

Gets the named type defined in the module, optionally ignoring the case of the type name. Optionally throws an exception if the type is not found.(Overrides Module.GetType(String, Boolean, Boolean).)

System_CAPS_pubmethodGetTypes()

Returns all the classes defined within this module.(Overrides Module.GetTypes().)

System_CAPS_pubmethodGetTypeToken(String)

Returns the token used to identify the type with the specified name.

System_CAPS_pubmethodGetTypeToken(Type)

Returns the token used to identify the specified type within this module.

System_CAPS_pubmethodIsDefined(Type, Boolean)

Returns a value that indicates whether the specified attribute type has been applied to this module.(Overrides Module.IsDefined(Type, Boolean).)

System_CAPS_pubmethodIsResource()

Gets a value indicating whether the object is a resource.(Overrides Module.IsResource().)

System_CAPS_pubmethodIsTransient()

Returns a value that indicates whether this dynamic module is transient.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodResolveField(Int32)

Returns the field identified by the specified metadata token.(Inherited from Module.)

System_CAPS_pubmethodResolveField(Int32, Type[], Type[])

Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.(Overrides Module.ResolveField(Int32, Type[], Type[]).)

System_CAPS_pubmethodResolveMember(Int32)

Returns the type or member identified by the specified metadata token.(Inherited from Module.)

System_CAPS_pubmethodResolveMember(Int32, Type[], Type[])

Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.(Overrides Module.ResolveMember(Int32, Type[], Type[]).)

System_CAPS_pubmethodResolveMethod(Int32)

Returns the method or constructor identified by the specified metadata token.(Inherited from Module.)

System_CAPS_pubmethodResolveMethod(Int32, Type[], Type[])

Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters. (Overrides Module.ResolveMethod(Int32, Type[], Type[]).)

System_CAPS_pubmethodResolveSignature(Int32)

Returns the signature blob identified by a metadata token.(Overrides Module.ResolveSignature(Int32).)

System_CAPS_pubmethodResolveString(Int32)

Returns the string identified by the specified metadata token.(Overrides Module.ResolveString(Int32).)

System_CAPS_pubmethodResolveType(Int32)

Returns the type identified by the specified metadata token.(Inherited from Module.)

System_CAPS_pubmethodResolveType(Int32, Type[], Type[])

Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.(Overrides Module.ResolveType(Int32, Type[], Type[]).)

System_CAPS_pubmethodSetCustomAttribute(ConstructorInfo, Byte[])

Applies a custom attribute to this module by using a specified binary large object (BLOB) that represents the attribute.

System_CAPS_pubmethodSetCustomAttribute(CustomAttributeBuilder)

Applies a custom attribute to this module by using a custom attribute builder.

System_CAPS_pubmethodSetSymCustomAttribute(String, Byte[])

This method does nothing.

System_CAPS_pubmethodSetUserEntryPoint(MethodInfo)

Sets the user entry point.

System_CAPS_pubmethodToString()

Returns the name of the module.(Inherited from Module.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.(Inherited from Module.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can then be used to get the type information for an interface.(Inherited from Module.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.GetTypeInfoCount(UInt32)

Retrieves the number of type information interfaces that an object provides (either 0 or 1).(Inherited from Module.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Module.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.(Inherited from Module.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ModuleBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

For a description of this member, see _ModuleBuilder.GetIDsOfNames.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ModuleBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

For a description of this member, see _ModuleBuilder.GetTypeInfo.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ModuleBuilder.GetTypeInfoCount(UInt32)

For a description of this member, see _ModuleBuilder.GetTypeInfoCount.

System_CAPS_pubinterfaceSystem_CAPS_privmethod_ModuleBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

For a description of this member, see _ModuleBuilder.Invoke.

NameDescription
System_CAPS_pubmethodGetCustomAttribute(Type)

Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttribute<'T>()

Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttributes()

Overloaded. Retrieves a collection of custom attributes that are applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodGetCustomAttributes(Type)

Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified module.(Defined by CustomAttributeExtensions.)

System_CAPS_pubmethodIsDefined(Type)

Overloaded. Indicates whether custom attributes of a specified type are applied to a specified module.(Defined by CustomAttributeExtensions.)

To get an instance of ModuleBuilder, use the AssemblyBuilder.DefineDynamicModule method.

The following code sample demonstrates the use of ModuleBuilder to create a dynamic module. Note that the ModuleBuilder is created by calling DefineDynamicModule in AssemblyBuilder, rather than through a constructor.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Silverlight
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft