Class AssemblyLoader
Loads a .NET module from disk and writes it back, preserving metadata.
public class AssemblyLoader : IDisposable
- Inheritance
-
AssemblyLoader
- Implements
- Inherited Members
Constructors
AssemblyLoader(string)
Initializes a new instance of the AssemblyLoader class and loads the module.
public AssemblyLoader(string path)
Parameters
pathstringPath to the module file.
Exceptions
- FileNotFoundException
The file does not exist or could not be loaded as a module.
Properties
ModuleDefMD
Gets the loaded module.
public ModuleDefMD ModuleDefMD { get; }
Property Value
- ModuleDefMD
Methods
Dispose()
Releases the loaded module.
public void Dispose()
GetAssemblyContext()
Creates an AssemblyContext for the loaded module.
public AssemblyContext GetAssemblyContext()
Returns
- AssemblyContext
A new AssemblyContext.
Write(string, bool)
Writes the module to disk, using the native writer for mixed-mode modules.
public void Write(string path, bool writePdb = true)
Parameters
Exceptions
- FileNotFoundException
The module could not be saved.