Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

AppDomain.Load Method (AssemblyName)

Loads an Assembly given its AssemblyName.

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

public Assembly Load (
	AssemblyName assemblyRef
)
public final Assembly Load (
	AssemblyName assemblyRef
)
public final function Load (
	assemblyRef : AssemblyName
) : Assembly

Parameters

assemblyRef

An object that describes the assembly to load.

Return Value

The loaded assembly.

Exception typeCondition

ArgumentNullException

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

FileNotFoundException

assemblyRef is not found.

BadImageFormatException

assemblyRef is not a valid assembly.

AppDomainUnloadedException

Operations are attempted on an unloaded application domain.

FileLoadException

An assembly or module was loaded twice with two different evidences.

This method should only be used to load an assembly into the current application domain. This method is defined for interoperability callers who cannot call the static Load method.

An attempt to call Load on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an Assembly is not MarshalByRefObject, when this method attempts to return the Assembly for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different.

NoteNote

If both the AssemblyName.Name property and the AssemblyName.CodeBase property are set, the first attempt to load the assembly uses the display name (including version, culture, and so on, as returned by the Assembly.FullName property). If the file is not found, the CodeBase property is used to search for the assembly. If the assembly is found using CodeBase, the display name is matched against the assembly. If the match fails, a FileLoadException is thrown.

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

Community Additions

ADD
Show:
© 2015 Microsoft