See Also: ConstructorBuilder Members
System.Reflection.Emit.ConstructorBuilder is used to fully describe a constructor in Microsoft intermediate language (MSIL), including the name, attributes, signature, and constructor body. It is used in conjunction with the System.Reflection.Emit.TypeBuilder class to create classes at run time. Call TypeBuilder.DefineConstructor(System.Reflection.MethodAttributes, System.Reflection.CallingConventions, Type[]) to get an instance of System.Reflection.Emit.ConstructorBuilder.
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 use System.Reflection.Emit.ConstructorBuilder to 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:
If you want a default constructor that simply calls the default constructor of the base class, you can use the TypeBuilder.DefineDefaultConstructor(System.Reflection.MethodAttributes) method to create one (and optionally restrict access to it). Do not provide an implementation for this default constructor. If you do, an exception is thrown when you try to use the constructor. No exception is thrown when the TypeBuilder.CreateType method is called.
If you want a default constructor that does something more than simply calling the default constructor of the base class, or that calls another constructor of the base class, or that does something else entirely, you must use the TypeBuilder.DefineConstructor(System.Reflection.MethodAttributes, System.Reflection.CallingConventions, Type[]) method to create a System.Reflection.Emit.ConstructorBuilder, and provide your own implementation.