Click or drag to resize
TypeGetType Method (String)
Gets the Type with the specified name, performing a case-sensitive search.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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: Type
The type with the specified name, if found; otherwise, null.
Exceptions
ExceptionCondition
ArgumentNullExceptiontypeName is null.
TargetInvocationExceptionA class initializer is invoked and throws an exception.
ArgumentExceptiontypeName 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.
TypeLoadExceptiontypeName represents an array of TypedReference.
FileLoadExceptionThe assembly or one of its dependencies was found, but could not be loaded.
BadImageFormatExceptionThe 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