Class AssemblyLoadContextTracker
- Namespace
- Ecng.Compilation
- Assembly
- Ecng.Compilation.dll
Provides tracking functionality for AssemblyLoadContext instances when loading assemblies dynamically. Implements ICompilerContext and manages unloading of previous contexts when loading a new assembly.
public class AssemblyLoadContextTracker : Disposable, ICompilerContext, IDisposable
- Inheritance
-
AssemblyLoadContextTracker
- Implements
- Inherited Members
- Extension Methods
Constructors
AssemblyLoadContextTracker(Action<Exception>)
Provides tracking functionality for AssemblyLoadContext instances when loading assemblies dynamically. Implements ICompilerContext and manages unloading of previous contexts when loading a new assembly.
public AssemblyLoadContextTracker(Action<Exception> uploadingError = null)
Parameters
Methods
DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
protected override void DisposeManaged()
LoadFromBinary(byte[])
Loads an assembly from the provided binary data. If a different assembly is passed than the one previously loaded, the previous context is unloaded.
public Assembly LoadFromBinary(byte[] assembly)
Parameters
assembly
byte[]The binary representation of the assembly to load.
Returns
Unload()
Unloads the current AssemblyLoadContext and resets the internal state.
public void Unload()