Assembly.GetType Method (String)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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


Public Overridable Function GetType ( _
    name As String _
) As Type
public virtual Type GetType(
    string name


Return Value

Type: System.Type
A Type object that represents the specified class, or nulla null reference (Nothing in Visual Basic) if the class is not found.


Exception Condition

name is invalid.


name is nulla null reference (Nothing in Visual Basic).


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.

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 GetType throws a TypeLoadException exception instead of an ArgumentException exception when name is nulla null reference (Nothing in Visual Basic). If name is an invalid name, GetType returns nulla null reference (Nothing in Visual Basic).

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.