Defines the default constructor. The constructor defined here will simply call the default constructor of the parent.
[Visual Basic] Public Function DefineDefaultConstructor( _ ByVal attributes As MethodAttributes _ ) As ConstructorBuilder [C#] public ConstructorBuilder DefineDefaultConstructor( MethodAttributes attributes ); [C++] public: ConstructorBuilder* DefineDefaultConstructor( MethodAttributes attributes ); [JScript] public function DefineDefaultConstructor( attributes : MethodAttributes ) : ConstructorBuilder;
Returns the constructor.
Exception Type | Condition |
---|---|
NotSupportedException | if the parent class does not have a default constructor |
Since the default constructor is automatically defined, it is only necessary to call this method if the attributes on the default constructor should be set to something other than MethodBase.Constructor. This method is provided here to make it easier to set the attributes.
TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace