Export (0) Print
Expand All

Defining a Dynamic Module

This topic identifies methods for creating a dynamic module.

Transient dynamic modules in a dynamic assembly are created using the AssemblyBuilder.DefineDynamicModule(String) method.

Persistable dynamic modules in a dynamic assembly are created using the AssemblyBuilder.DefineDynamicModule methods. The dynamic assembly must be created with the AssemblyBuilderAccess argument specified as Save or RunAndSave. DefineDynamicModule returns an AssemblyBuilder.

The following variations of AssemblyBuilder.DefineDynamicModule are provided:

  • Define a persistable dynamic module with the given name and the given file name.

  • Define a persistable dynamic module with the given name and the given file name, and conditionally emit symbolic information using the default implementation of the symbol writer interface.

The dynamic module is saved when the containing dynamic assembly is saved. By default, reflection emit generates DLLs. To generate a console application or a Windows-based application, the AssemblyBuilder.SetEntryPoint method must be called.

Show:
© 2014 Microsoft