0

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)?

kdmurray
  • 2,988
  • 3
  • 32
  • 47
  • 2
    Why not compile your library as a static library, not a DLL, then? – Kos Nov 21 '10 at 20:23
  • It's a .net project. Can one compile .net to a static library? – kdmurray Nov 22 '10 at 16:29
  • possible duplicate of [Static Linking of libraries created on C# .NET](http://stackoverflow.com/questions/1868449/static-linking-of-libraries-created-on-c-net) – kdmurray Dec 01 '10 at 09:21

2 Answers2

1

Don't make it a DLL. Make it a static library instead.

OJ.
  • 28,944
  • 5
  • 56
  • 71
1

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

Community
  • 1
  • 1
kdmurray
  • 2,988
  • 3
  • 32
  • 47