Take the 2-minute tour ×

I've created a basic console app in Visual Studio 2008, which references an external assembly.

When I publish and install the project, both the executable and the external assembly are installed in the target folder.

Is it possible to compile the project, and have all referenced assemblies included in the main executable - so there is only one file to distribute?

Thanks for any help,


share|improve this question

4 Answers 4

up vote 4 down vote accepted

You can use ILMerge to merge the assemblies for deployment. This lets you keep them separate during development, but put them all into one .exe file when you ship.

share|improve this answer
Thank you - just what I was looking for! –  frankie boyle Dec 8 '09 at 17:08

You can use ILMerge from Microsoft for this, or the Cecil tool from the Mono project.

share|improve this answer
Cecil doesn't merge assemblies. Well, you could write a merger with it, but there's no builtin feature. –  Jb Evain Dec 8 '09 at 17:02

You can create a setup file. so you can redistribute only one file. But it still going to be installed into a folder with each assembly separated.

You can also consider placing your assemblies into the GAC.

share|improve this answer
No, the GAC would complicate things unnecessarily. –  Henk Holterman Dec 8 '09 at 17:43
@Henk, I didn't recommend it. Just pointed out that this option is available. –  ArielBH Dec 9 '09 at 8:37

If you find ILMerge is not enough because your app needs files other than .net assemblies, I have found that packaging it as self extracting exe using MakeSFX works nicely. It sounds unlikely but with correct command line flags the self extracting bit is completely transparent and it runs just like any other application.

share|improve this answer

Your Answer


