The loaded assembly.
The assemblyFile parameter must refer to a URI without escape characters. This method supplies escape characters for all invalid characters in the URI.
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 context contains assemblies found by probing: in the GAC, in a host assembly store if the runtime is hosted, or in the AppDomainSetup.ApplicationBase and AppDomainSetup.PrivateBinPath of the application domain. Most overloads of the erload:System.Reflection.Assembly.Load method load assemblies into this context.
The load-from context contains assemblies for which the user provided a path not included in the directories searched by probing. erload:System.Reflection.Assembly.LoadFrom, erload:System.AppDomain.CreateInstanceFrom, and erload:System.AppDomain.ExecuteAssembly are examples of methods that load by path.
The reflection-only context contains assemblies loaded with the erload:System.Reflection.Assembly.ReflectionOnlyLoad and Assembly.ReflectionOnlyLoadFrom(string) methods; code in these contexts cannot be executed.
If the user generated or found the assembly, it is not in any context. This applies to assemblies loaded using overloads of the erload:System.Reflection.Assembly.Load method that specify a byte array containing an assembly, and to transient dynamic assemblies created with reflection emit and not saved to disk.
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.
If an assembly with the same identity is already loaded, erload:System.Reflection.Assembly.LoadFrom returns the loaded assembly even if a different path was specified.
If an assembly is loaded with erload:System.Reflection.Assembly.LoadFrom, and later an assembly in the load context attempts to load the same assembly by display name, the load attempt fails. This can occur when an assembly is de-serialized.
If an assembly is loaded with erload:System.Reflection.Assembly.LoadFrom, and the probing path includes an assembly with the same identity but a different location, an InvalidCastException, MissingMethodException, or other unexpected behavior can occur.
erload:System.Reflection.Assembly.LoadFrom demands System.Security.Permissions.FileIOPermissionAccess.Read and System.Security.Permissions.FileIOPermissionAccess.PathDiscovery, or System.Net.WebPermission, on the specified path.
If a native image exists for assemblyFile, it is not used. The assembly cannot be loaded as domain neutral.
In the .NET Framework version 1.0 and 1.1, policy is not applied.