5

Possible Duplicate:
Embedding DLLs in a compiled executable

Is it possible to embed a DLL into a console application If it is possible, how would one go about doing it?

Normally, I'm cool with just leaving the DLLs outside but there have been a couple of people at work who have asked me this and I honestly don't know.

Community
  • 1
  • 1
MANISHDAN LANGA
  • 2,227
  • 6
  • 29
  • 43

3 Answers3

2

If the libraries are also .NET, you can use ILMerge.

http://www.codeproject.com/Articles/9364/Merging-NET-assemblies-using-ILMerge

Edit (after learning it is native code)

Check out duplicate question here: How can a C++ windows dll be merged into a C# application exe?

or

Embedding unmanaged dll into a managed C# dll

Community
  • 1
  • 1
James
  • 2,445
  • 2
  • 25
  • 35
1

You can use SmartAssembly by Redgate as this can accomplish what you want. We use this tool to do exactly that.

Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
-1

You can use ILMerge for .NET assemblies. It won't work for native code.

ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output. See the accompanying documentation for details.

Download here: http://www.microsoft.com/en-us/download/details.aspx?id=17630

Dave New
  • 38,496
  • 59
  • 215
  • 394