TypeGetType Method (String) |
Gets the
Type with the specified name, performing a case-sensitive search.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static Type GetType(
string typeName
)
Parameters
- typeName
- Type: SystemString
The assembly-qualified name of the type to get. See AssemblyQualifiedName. If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace.
Return Value
Type:
TypeThe type with the specified name, if found; otherwise, null.
Exceptions Exception | Condition |
---|
ArgumentNullException | typeName is null. |
TargetInvocationException | A class initializer is invoked and throws an exception. |
ArgumentException | typeName represents a generic type that has a pointer type, a ByRef type, or Void as one of its type arguments.-or-typeName represents a generic type that has an incorrect number of type arguments.-or-typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. |
TypeLoadException | typeName represents an array of TypedReference. |
FileLoadException | The assembly or one of its dependencies was found, but could not be loaded. |
BadImageFormatException | The assembly or one of its dependencies is not valid. -or-Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version. |
See Also