System.Reflection.Assembly.LoadFile Method

Loads the contents of an assembly file on the specified path.

Syntax

public static Assembly LoadFile (string path)

Parameters

path
The path of the file to load.

Returns

The loaded assembly.

Remarks

Use the Assembly.LoadFile(string) method to load and examine assemblies that have the same identity, but are located in different paths. Assembly.LoadFile(string) does not load files into the Assembly.LoadFrom(string) context, and does not resolve dependencies using the load path, as the Assembly.LoadFrom(string) method does. Assembly.LoadFile(string) is useful in this limited scenario because Assembly.LoadFrom(string) cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.

Requirements

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