System.Reflection.Emit.TypeBuilder.DefineConstructor Method

Adds a new constructor to the type, with the given attributes and signature.

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public ConstructorBuilder DefineConstructor (System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type[] parameterTypes)

Parameters

attributes
The attributes of the constructor.
callingConvention
The calling convention of the constructor.
parameterTypes
The parameter types of the constructor.

Returns

The defined constructor.

Remarks

If you do not define a constructor for your dynamic type, a default constructor is provided automatically, and it calls the default constructor of the base class.

If you define a constructor for your dynamic type, a default constructor is not provided. You have the following options for providing a default constructor in addition to the constructor you defined:

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0