Question

I have a .NET 4.0 solution with about 10 projects that I am successfully compiling on mono 2.10.8.1 on Ubuntu Desktop 12.04, which is running in a VM.

I am trying to run mkbundle to combine all 10 DLLs into a single DLL that I can then reference in other solutions (i.e. some core libraries that will be heavily reused in higher level applications).

This is what I am running to build the solution:

xbuild /nologo CoreApp.sln

Then I am running the following to combine the DLLs:

mkbundle -c --nomain -o Build/CoreApp.dll Build/FirstLibrary.dll Build/SecondLibrary.dll Build/ThirdLibrary.dll

This successfully completes, and I get CoreApp.dll.

However, when I try to build the dependent solution, I get the following exception:

Error CS0009: Metadata file `/home/user/project/Build/CoreApp.dll' does not contain valid metadata (CS0009) (HigherLevelApp.Impl)

I'd be happy to provide more information if necessary.

Was it helpful?

Solution

mkbundle is for creating a standalone binary, not merging several libraries into one.

You want something like il-merge.

OTHER TIPS

mkbundle is not an IL merger. The output of the tool is a self contained application (with or without mono itself). As such it's not usable anymore by other .NET projects.

What mkbundle allows you is to distribute a single file that contains everything you need to execute a single .NET application.

What you're looking for is a way to merge several assemblies into a new assembly. Microsoft has such a tool and a few other products (many based on Mono.Cecil) do similar things.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top