Table of Contents

Class Assembly

Namespace
System.Reflection
Assembly
mscorlib.dll

Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.

public class Assembly
Inheritance
Assembly
Inherited Members
Extension Methods

Constructors

Assembly()

public Assembly()

Properties

FullName

Gets the display name of the assembly.

public virtual string FullName { get; }

Property Value

string

The display name of the assembly.

Methods

GetAssembly(Type)

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

public static Assembly GetAssembly(Type type)

Parameters

type Type

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

Returns

Assembly

The assembly in which the specified type is defined.

GetExecutingAssembly()

Gets the assembly that contains the code that is currently executing.

public static Assembly GetExecutingAssembly()

Returns

Assembly

The assembly that contains the code that is currently executing.

GetName()

Gets an AssemblyName for this assembly.

public AssemblyName GetName()

Returns

AssemblyName

An object that contains the fully parsed display name for this assembly.

GetSatelliteAssembly(CultureInfo)

Gets the satellite assembly for the specified culture.

public Assembly GetSatelliteAssembly(CultureInfo culture)

Parameters

culture CultureInfo

The specified culture.

Returns

Assembly

The specified satellite assembly.

Exceptions

ArgumentNullException

culture is null.

ArgumentException

GetType(string)

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

public virtual Type GetType(string name)

Parameters

name string

The full name of the type.

Returns

Type

An object that represents the specified class, or null if the class is not found.

GetType(string, bool)

Gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

public virtual Type GetType(string name, bool throwOnError)

Parameters

name string

The full name of the type.

throwOnError bool

true to throw an exception if the type is not found; false to return null.

Returns

Type

An object that represents the specified class.

Exceptions

ArgumentException

GetTypes()

Gets the types defined in this assembly.

public virtual Type[] GetTypes()

Returns

Type[]

An array that contains all the types that are defined in this assembly.

Load(byte[])

Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the application domain of the caller.

public static Assembly Load(byte[] rawAssembly)

Parameters

rawAssembly byte[]

A byte array that is a COFF-based image containing an emitted assembly.

Returns

Assembly

The loaded assembly.

Exceptions

ArgumentException

rawAssembly is not a valid assembly.

Load(string)

Loads an assembly given the long form of its name.

public static Assembly Load(string assemblyString)

Parameters

assemblyString string

The long form of the assembly name.

Returns

Assembly

The loaded assembly.

Exceptions

ArgumentNullException

assemblyString is null.