System.Reflection.Assembly.LoadFrom Method

Loads an assembly given its file name or path.

Syntax

public static Assembly LoadFrom (string assemblyFile)

Parameters

assemblyFile
The name or path of the file that contains the manifest of the assembly.

Returns

The loaded assembly.

Remarks

The assemblyFile parameter must refer to a URI without escape characters. This method supplies escape characters for all invalid characters in the URI.

Note:

File transfer protocol (FTP) is not supported. If the URI supplied for assemblyFile is an FTP address, the assembly is not loaded. No exception is thrown.

assemblyFile may be absolute or relative to the current directory, and the assembly is loaded into the domain of the caller.

Assemblies can be loaded into one of three contexts, or can be loaded without context:

The load-from context allows an assembly to be loaded from a path not included in probing, and yet allows dependencies on that path to be found and loaded because the path information is maintained by the context.

The erload:System.Reflection.Assembly.LoadFrom method has the following disadvantages. Consider using erload:System.Reflection.Assembly.Load instead.

Requirements

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