GetType Method (String)
Collapse the table of content
Expand the table of content

Assembly.GetType Method (String)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the Type object with the specified name in the assembly instance.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public virtual Type GetType(
	string name


Type: System.String
The full name of the type.

Return Value

Type: System.Type
A Type object that represents the specified class, or null if the class is not found.


name is invalid.


name is null.


name requires a dependent assembly that could not be found.


name requires a dependent assembly that was found but could not be loaded.


The current assembly was loaded into the reflection-only context, and name requires a dependent assembly that was not preloaded.


name requires a dependent assembly, but the file is not a valid assembly.


name requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.


The method is invoked late-bound through mechanisms such as Type.InvokeMember.

This method only searches the current assembly instance. The name parameter includes the namespace but not the assembly.


If the type has been forwarded to another assembly, it is still returned by this method.

A type can be retrieved from a specific module using Module.GetType. Calling Module.GetType on the module containing the manifest will not initiate a search of the entire assembly.

Version Notes

Windows Phone

 GetType throws a TypeLoadException exception instead of an ArgumentException exception when name is null. If name is an invalid name, GetType returns null.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft