AssemblyLoadContext Class

Definition

Represents the runtime's concept of a scope for assembly loading.

public class AssemblyLoadContext
public abstract class AssemblyLoadContext
Inheritance
AssemblyLoadContext

Remarks

For more information about this API, see Supplemental API remarks for AssemblyLoadContext.

Constructors

AssemblyLoadContext()

Initializes a new instance of the AssemblyLoadContext class.

AssemblyLoadContext(Boolean)

Initializes a new instance of the AssemblyLoadContext class with a value that indicates whether unloading is enabled.

AssemblyLoadContext(String, Boolean)

Initializes a new instance of the AssemblyLoadContext class with a name and a value that indicates whether unloading is enabled.

Properties

All

Returns a collection of all AssemblyLoadContext instances.

Assemblies

Returns a collection of the Assembly instances loaded in the AssemblyLoadContext.

CurrentContextualReflectionContext

Gets the AssemblyLoadContext set by the most recent call to EnterContextualReflection().

Default

Gets the default AssemblyLoadContext. The default context contains the main application assembly and its static dependencies.

IsCollectible

Gets a value that indicates whether this AssemblyLoadContext is collectible.

Name

Get the name of the AssemblyLoadContext.

Methods

EnterContextualReflection()

Sets CurrentContextualReflectionContext to thisAssemblyLoadContext.

EnterContextualReflection(Assembly)

Sets CurrentContextualReflectionContext to the AssemblyLoadContext which loaded the assembly.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize()

Allows the object to try to free resources and perform other cleanup operations before it's reclaimed by garbage collection.

GetAssemblyName(String)

Gets an AssemblyName for an assembly path.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLoadContext(Assembly)

Gets the AssemblyLoadContext containing the specified Assembly.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
Load(AssemblyName)

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

LoadFromAssemblyName(AssemblyName)

Resolves and loads an assembly given its AssemblyName.

LoadFromAssemblyPath(String)

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

LoadFromNativeImagePath(String, String)

Loads the contents of the native image of a managed assembly file on the specified path.

LoadFromStream(Stream, Stream)

Loads the assembly with a common object file format (COFF)-based image containing a managed assembly, optionally including symbols for the assembly.

LoadFromStream(Stream)

Loads the assembly with a common object file format (COFF)-based image containing a managed assembly.

LoadUnmanagedDll(String)

Allows derived class to load an unmanaged library by name.

LoadUnmanagedDllFromPath(String)

Loads an unmanaged library from the specified path.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetProfileOptimizationRoot(String)

Sets the root path where the optimization profiles for this load context are stored.

StartProfileOptimization(String)

Starts the profile optimization for the specified profile.

ToString()

Returns the string representation of this load context.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
Unload()

Initiates an unload of this AssemblyLoadContext.

Events

Resolving

Occurs when the resolution of an assembly fails when attempting to load into this assembly load context.

ResolvingUnmanagedDll

Occurs when the resolution of a native library fails.

Unloading

Occurs when the AssemblyLoadContext is unloaded.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9

See also