visual-studiostatic-linkingdynamic-linking

Is there a way to join (link?) a managed (.net) dll at compile time?


I'm building a project which consists of two .net executables, and a class library with common components that the two executables share. For ease of distribution, I was hoping to be able to distribute the two executables without distributing the dll (grab & run distribution).

Is there any way to have visual studio compile the contents of the dll into each executable without manually copying the classes into each project (and thereby replicating the code in more than one place)?


Solution

  • Digging around on SO I found a duplicate question which stated the problem quite a bit more clearly than I did.

    ILMerge seems to be the solution.

    Static Linking of libraries created on C# .NET