Export (0) Print
Expand All

_AppDomain.Load Method (Byte[])

.NET Framework 1.1

Loads the Assembly with a COFF based image containing an emitted Assembly.

[Visual Basic]
Function Load( _
   ByVal rawAssembly() As Byte _
) As Assembly
Assembly Load(
   byte[] rawAssembly
Assembly* Load(
   unsigned char rawAssembly __gc[]
function Load(
   rawAssembly : Byte[]
) : Assembly;


An array of type byte that is a COFF-based image containing an emitted assembly.

Return Value

The loaded assembly.


Exception Type Condition
ArgumentNullException rawAssembly is a null reference (Nothing in Visual Basic).
BadImageFormatException rawAssembly is not a valid assembly.


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 Assembly.Load method.

An attempt to call AppDomain.Load on an application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since Assembly objects are not MarshalByRef, when the method attempts to return the Assembly object for the loaded assembly to the current application domain, the runtime will try to load the specified 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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

_AppDomain Interface | _AppDomain Members | System Namespace | _AppDomain.Load Overload List

© 2015 Microsoft