Assembly.GetAssembly Method (Type)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the currently loaded assembly in which the specified type is defined.

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

static member GetAssembly : 
        type:Type -> Assembly


Type: System.Type

An object representing a type in the assembly that will be returned.

Return Value

Type: System.Reflection.Assembly

The assembly in which the specified type is defined.

Exception Condition

type is null.

Calling this method is equivalent to retrieving the value of the Type.Assembly property. However, the Type.Assembly property typically offers superior performance.

In order to call this method, you must have a Type object, which means that the assembly in which the class is defined must already be loaded.

The following example retrieves the assembly that contains the Int32 type and displays its name and file location.

No code example is currently available or this language may not be supported.


when invoked late-bound through mechanisms such as Type.InvokeMember. Associated enumeration: ReflectionPermissionFlag.MemberAccess

.NET Framework
Available since 1.1
Return to top