Table of Contents

Class AssemblyLoader

Namespace
Embedix.Core.dnlib.Loading
Assembly
Embedix.Core.dll

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

path string

Path 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

path string

Destination file path.

writePdb bool

true to also write a PDB file; otherwise false.

Exceptions

FileNotFoundException

The module could not be saved.