Assembly.GetType Method (String)

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
Dim instance As Assembly
Dim name As String
Dim returnValue As Type

returnValue = instance.GetType(name)
public Type GetType (
	String name
public function GetType (
	name : String
) : Type



The full name of the type.

Return Value

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

Exception typeCondition


name is invalid.


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

This method only searches the current assembly instance. The name parameter includes the namespace but not the assembly. To search other assemblies for a type, use the Type.GetType method overload, which can optionally include an assembly display name as part of the type name.

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. To retrieve a type from an assembly, regardless of which module it is in, you must call GetType.

  • ReflectionPermission  when invoked late-bound through mechanisms such as Type.InvokeMember. Associated enumeration: ReflectionPermissionFlag.MemberAccess.
  • ReflectionPermission  for reflecting types that are not publicly visible. Associated enumerations: ReflectionPermissionFlag.MemberAccess, ReflectionPermissionFlag.TypeInformation

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions