System.Reflection.Assembly.Load Method

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

Syntax

[System.Obsolete]
public static Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, System.Security.Policy.Evidence securityEvidence)

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.
securityEvidence
Evidence for loading the assembly.

Returns

The loaded assembly.

Remarks

The assembly is loaded into the domain of the caller using the supplied evidence. The raw bytes representing the symbols for the assembly are also loaded.

Whether certain permissions are granted or not granted to an assembly is based on evidence. The rules for assembly and security evidence merging are as follows:

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.

If you call the Assembly.Load(Byte[], Byte[], System.Security.Policy.Evidence) method more than once on the same assembly but with a different evidence specified, the common language runtime does not throw a System.IO.FileLoadException because the equality and integrity of the different evidence specifications cannot be determined. The evidence that first succeeds is the evidence that is used.

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