Method LoadFromAssemblyNameUsingPath
LoadFromAssemblyNameUsingPath(AssemblyLoadContext, String)
Loads an assembly by first retrieving it's AssemblyName from the given path. If the
assembly has not already been loaded into the context and cannot be resolved by name, the assembly is
then directly loaded from the provided path. This avoids loading an assembly of the same name again if
it has already been loaded before.
Declaration
public static Assembly LoadFromAssemblyNameUsingPath(this AssemblyLoadContext assemblyLoadContext, string path)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Loader.AssemblyLoadContext | assemblyLoadContext | The System.Runtime.Loader.AssemblyLoadContext instance used to load the assembly. |
String | path | Path of the assembly file to load if an assembly of the same name is not yet loaded. |
Returns
Type | Description |
---|---|
Assembly | The Assembly instance on success, otherwise null . |
Remarks
Note, that the returned assembly may be a different assembly using the same name as the assembly
specified by the given path.