System.Reflection.Assembly.Load Method

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

Syntax

public static Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore)

Parameters

rawAssembly
A byte array that is a COFF-based image containing an emitted assembly.
rawSymbolStore
A byte array that contains the raw bytes representing the symbols for the assembly.

Returns

The loaded assembly.

Remarks

The trust level of an assembly that is loaded by using this method is the same as the trust level of the calling assembly. To load an assembly from a byte array with the trust level of the application domain, use the Assembly.Load(Byte[], Byte[], System.Security.SecurityContextSource) method overload. For more information about the use of evidence with overloads of the Assembly.Load(Byte[], Byte[]) method that take byte arrays, see the Assembly.Load(Byte[], Byte[], System.Security.Policy.Evidence) method overload.

Reflecting on C++ executable files might throw a BadImageFormatException. This is most likely caused by the C++ compiler stripping the relocation addresses or the .reloc section from your executable file. To preserve the .reloc address for your C++ executable file, specify /fixed:no when you are linking.

Note that this method overload always creates a new System.Reflection.Assembly object with its own mapping.

Requirements

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