Standard ILMerge Doesn't Work With Unmanaged DLLs

A lot of people are wondering whether it's possible to ILMerge unmanaged DLLs. Unfortunately, standard ILmerge can't do it. It supports .Net modules only.

But with BoxedApp Packer you can include both managed and unmanaged DLLs into an executable file.

The Virtualization To The Rescue!

For BoxedApp Packer it doesn't matter what kind of files are packed together, that's why it's possible to avoid ILMerge restrictions. ILMerge copies all definitions, the code, the metadata from one assembly to another one. At the same time, an executable made by BoxedApp Packer uses virtualization: embedded files are emulated (being located in memory, not at a disk).

How it works? Each call to the file system are intercepted and preprocessed, thus it's possible to create pseudofiles (in BoxedApp we call them "virtual files"). It doesn't matter if such file is a DLL (managed or unmanaged), a data file, a video file, or a database file etc.

Let's Start

First of all download BoxedApp Packer and run it. You will see the main window. There are editboxes to specify input and output (i.e. packed) files, there are predefined directories (Application Directory, System32 and others).

Select your .Net executable, add required unmanaged DLLs to Application Directory:

Build it and run. It works!

Screenshots

Main Window
Main Window
Select .Net exe
Select .Net exe
Packed .Net exe
Packed .Net exe

Download

Both sources and BoxedApp Packer project are available on GitHub.