Is there a way to pack more than one .NET assembly in a DLL?

I want my components / nodes to be clearly separated from the point of view of the source code, but I also need to package them in the same DLL in some cases (possibly not related to the extension).

Is it possible to pack multiple .NET assemblies in one DLL? If so, how?

IF maybe you think this is a good idea? Why?

Any help appreciated!

+6
dll packaging assemblies
source share
2 answers

Check out this article: Combining .NET Collections Using ILMerge


As you know, the traditional object code binding is no longer needed on. NETWORK. Typically, a .NET program consists of several parts. A typical .NET application consists of an executable assembly, several assemblies in the program directory, and several assemblies in the global cache assembly. When the program starts, runtime combines all of these parts with the program. Compile-time binding is no longer necessary.

But sometimes it’s still useful to combine all parts of the program you need to perform in one assembly. For example, you might want to simplify the deployment of your application by combining a program, all the necessary libraries, and all resources into a single .exe file.

csc /target:library /out:ClassLibrary1.dll ClassLibrary1.cs vbc /target:library /out:ClassLibrary2.dll ClassLibrary2.vb vbc /target:winexe /out:Program.exe /reference:ClassLibrary1.dll,ClassLibrary2.dll Program.vb 

.

 ilmerge /target:winexe /out:SelfContainedProgram.exe Program.exe ClassLibrary1.dll ClassLibrary2.dll 
+9
source share

ILMerge can combine two assemblies into one.

See here for information (examples relate to cross language, but will work with any tools created by assemblies).

Obviously, any dependencies on individual assemblies (pre-merge) should be updated / redirected.

+6
source share

All Articles