AssemblyLoadContext Constructors

Definition

Overloads

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.

AssemblyLoadContext()

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs

Initializes a new instance of the AssemblyLoadContext class.

C#
protected AssemblyLoadContext();

Remarks

This constructor is protected. It can only be called from the AssemblyLoadContext class or its derived classes.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.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, 10

AssemblyLoadContext(Boolean)

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs

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

C#
protected AssemblyLoadContext(bool isCollectible);

Parameters

isCollectible
Boolean

true to enable Unload(); otherwise, false. The default value is false because there is a performance cost associated with enabling unloading.

Remarks

This constructor is protected. It can only be called from the AssemblyLoadContext class or its derived classes.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

AssemblyLoadContext(String, Boolean)

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs

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

C#
public AssemblyLoadContext(string? name, bool isCollectible = false);

Parameters

name
String

The value for Name in the new instance. Its value can be null.

isCollectible
Boolean

true to enable Unload(); otherwise, false. The default value is false because there is a performance cost associated with enabling unloading.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10