Bewerken

Delen via


AssemblyLoadContext.Load(AssemblyName) Method

Definition

When overridden in a derived class, allows an assembly to be resolved based on its AssemblyName.

protected:
 virtual System::Reflection::Assembly ^ Load(System::Reflection::AssemblyName ^ assemblyName);
protected:
 abstract System::Reflection::Assembly ^ Load(System::Reflection::AssemblyName ^ assemblyName);
protected virtual System.Reflection.Assembly? Load (System.Reflection.AssemblyName assemblyName);
protected abstract System.Reflection.Assembly Load (System.Reflection.AssemblyName assemblyName);
abstract member Load : System.Reflection.AssemblyName -> System.Reflection.Assembly
override this.Load : System.Reflection.AssemblyName -> System.Reflection.Assembly
abstract member Load : System.Reflection.AssemblyName -> System.Reflection.Assembly
Protected Overridable Function Load (assemblyName As AssemblyName) As Assembly
Protected MustOverride Function Load (assemblyName As AssemblyName) As Assembly

Parameters

assemblyName
AssemblyName

The object that describes the assembly to be resolved.

Returns

The resolved assembly, or null.

Remarks

During assembly resolution, the Load(AssemblyName) method has the first chance to resolve the assembly name to a loaded assembly. It can load an assembly and return it, return an already loaded assembly, or return null. If it returns null, the resolution process continues. For the full process description, see Managed assembly loading algorithm.

Implementations of this method can return an assembly loaded into any AssemblyLoadContext, not just the instance it was called on. Returning an assembly from a different AssemblyLoadContext does not result in that assembly becoming associated with this instance.

Important

To prevent recursive stack overflow, do not call this instance's LoadFromAssemblyName(AssemblyName) method from this method.

Applies to

See also