Returns a public instance constructor defined in the type represented by the current instance. The parameters of the constructor match the specified argument types.
- types
- An array of Type objects. The elements in the array are of the same number, in the same order, and represent the same types as the parameters for the constructor to be returned. Specify Type.EmptyTypes to obtain a constructor that takes no parameters.
A System.Reflection.ConstructorInfo object representing the public instance constructor whose parameters match exactly the types in types , if found; otherwise, null. If the type represented by the current instance is contained in a loaded assembly, the constructor that matches the specified criteria is not public, and the caller does not have sufficient permissions, returns null.
If the current instance represents a generic type, this method returns the System.Reflection.ConstructorInfo with the type parameters replaced by the appropriate type arguments. If the current instance represents an unassigned type parameter of a generic type or method, this method always returns null.
Type Reason System.Security.Permissions.ReflectionPermission Requires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.
Type Reason ArgumentNullException types is null, or at least one of the elements in types is null. ArgumentException types has more than one dimension.
This version of Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, Type[], System.Reflection.ParameterModifier[]) is equivalent to Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, Type[], System.Reflection.ParameterModifier[])(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance, null, types, null).
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0