Table of Contents

Class Embedder

Namespace
Embedix.Core
Assembly
Embedix.Core.dll

Embeds library files into a target assembly as compressed resources and merges the runtime payload (an assembly resolver) that loads them on demand.

public class Embedder
Inheritance
Embedder
Inherited Members

Constructors

Embedder()

public Embedder()

Methods

Execute(AssemblyContext, string[], string, string)

Embeds the given libraries into the target assembly and wires up the runtime resolver.

public static void Execute(AssemblyContext context, string[] librarys, string typeName = "AssemblyResolver", string @namespace = "Embedix")

Parameters

context AssemblyContext

The context of the assembly that receives the embedded libraries.

librarys string[]

Paths of the library files to embed. Each is deflate-compressed and stored as a resource named Embedded.<file name>.

typeName string

The name of the type to merge.

namespace string

The namespace of the type to merge.

Remarks

After the resources are added, the payload module matching the target's core library is loaded, its AssemblyResolver type is merged into the target, and a call to its Resolve method is inserted at the start of the module static constructor. If the merge does not produce a copy (for example because the type was already injected), no call is inserted.

ExecuteWithResult(AssemblyContext, string[], string, string)

Embeds the given libraries into the target assembly and wires up the runtime resolver.

public static EmbedResult ExecuteWithResult(AssemblyContext context, string[] librarys, string typeName = "AssemblyResolver", string @namespace = "Embedix")

Parameters

context AssemblyContext

The context of the assembly that receives the embedded libraries.

librarys string[]

Paths of the library files to embed. Each is deflate-compressed and stored as a resource named Embedded.<file name>.

typeName string

The name of the type to merge.

namespace string

The namespace of the type to merge.

Returns

EmbedResult

An EmbedResult containing the embedded libraries, original and compressed sizes, and any warnings generated during execution.