Export (0) Print
Expand All

AssemblyBuilder.DefineDynamicModule Method (String, Boolean)

Defines a named transient dynamic module in this assembly and specifies whether symbol information should be emitted.

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

[SecuritySafeCriticalAttribute]
public ModuleBuilder DefineDynamicModule(
	string name,
	bool emitSymbolInfo
)

Parameters

name
Type: System.String
The name of the dynamic module. Must be less than 260 characters long.
emitSymbolInfo
Type: System.Boolean
true to emit symbol information; otherwise, false.

Return Value

Type: System.Reflection.Emit.ModuleBuilder
The new dynamic module.

ExceptionCondition
ArgumentException

name begins with white space.

-or-

The length of name is zero.

-or-

The length of name is greater than or equal to 260.

ArgumentNullException

name is null.

ExecutionEngineException

The assembly for the default symbol writer cannot be loaded.

-or-

The type that implements the default symbol writer interface cannot be found.

InvalidOperationException

A dynamic module has already been created in this assembly.

In Silverlight-based applications, you can define only one dynamic module in an assembly.

NoteNote:

To suppress optimizations when you debug dynamic modules, apply the DebuggableAttribute attribute to the dynamic assembly before you call DefineDynamicModule. Create an instance of DebuggableAttribute with the DisableOptimizations flag and apply it using the SetCustomAttribute method. The attribute must be applied to the dynamic assembly. It has no effect if it is applied to the module.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft