AssemblyLoadContextTracker

Ecng.Compilation

Provides tracking functionality for AssemblyLoadContext instances when loading assemblies dynamically. Implements ICompilerContext and manages unloading of previous contexts when loading a new assembly.

Erbt von: Disposable

Implementiert: ICompilerContext, IDisposable

Konstruktoren

AssemblyLoadContextTracker
public AssemblyLoadContextTracker(Action<Exception> uploadingError)
assemblyLoadContextTracker = AssemblyLoadContextTracker(uploadingError)

Provides tracking functionality for AssemblyLoadContext instances when loading assemblies dynamically. Implements ICompilerContext and manages unloading of previous contexts when loading a new assembly.

Methoden

DisposeManaged
protected override void DisposeManaged()
assemblyLoadContextTracker.DisposeManaged()

Disposes the managed resources. Override this method to add custom clean up of managed resources.

LoadFromBinary
public Assembly LoadFromBinary(byte[] assembly)
result = assemblyLoadContextTracker.LoadFromBinary(assembly)

Loads an assembly from the provided binary data. If a different assembly is passed than the one previously loaded, the previous context is unloaded.

assembly
The binary representation of the assembly to load.

Rückgabe: The loaded Assembly instance.

Unload
public void Unload()
assemblyLoadContextTracker.Unload()

Unloads the current AssemblyLoadContext and resets the internal state.