System.Type.GetTypeFromHandle Method

Gets the type referenced by the specified type handle.

Syntax

public static Type GetTypeFromHandle (RuntimeTypeHandle handle)

Parameters

handle
The object that refers to the type.

Returns

The type referenced by the specified RuntimeTypeHandle, or null if the RuntimeTypeHandle.Value property of handle is null.

Exceptions

TypeReason
ArgumentNullException handle is null.
System.Security.SecurityExceptionThe requested type is non-public and outside the current assembly, and the caller does not have the required permission.
System.Reflection.TargetInvocationExceptionA type initializer was invoked and threw an exception.

Remarks

The handles are valid only in the application domain in which they were obtained.

Permissions

TypeReason
System.Security.Permissions.ReflectionPermissionRequires permission to retrieve information on non-public objects. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0