• Stars
    star
    305
  • Rank 136,879 (Top 3 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Serialize .NET Core assemblies

Lokad.ILPack

Exports a .NET type to a serialized assembly, with support for dynamic assemblies (i.e. custom IL generation). This library is intended as a drop-in replacement for the AssemblyBuilder.Save method which existed since .NET 1.1 but that has not been ported to .NET Core 3.0.

To install with NuGet:

Install-Package Lokad.ILPack

Usage:

var assembly = Assembly.GetAssembly(t);
var generator = new Lokad.ILPack.AssemblyGenerator();

// for ad-hoc serialization
var bytes = generator.GenerateAssemblyBytes(assembly);

// direct serialization to disk
generator.GenerateAssembly(assembly, "/path/to/file");

Released under the MIT license.