Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create .exe from c# windows application

I have a created a visual studio 2010 project that creates a windows form - it references numerous other dll's.

How can I wrap this up in to a single .exe file?

like image 952
amateur Avatar asked Jul 19 '11 16:07

amateur


1 Answers

ILMerge is what you are looking for with the /t:exe option.

A sample call would look like this:

ilmerge.exe exefile.exe [dlls-to-internalize.dll ..] /out:exefile-out.exe /t:exe

A sample usage of using ILMerge to pack up multiple dlls into one and internalizing them can be found here: dotlesscss buildfile

More info on using ILMerge can be found on the ILMerge Website. You can also get it through NuGet via Chocolatey

It allows you to pack multiple .NET assemblies into one file by rewriting the references. You can also internalize your dependencies in case you are supplying a library to someone and don't want to cause dependency conflicts with libraries you are internally using.

like image 96
Tigraine Avatar answered Sep 19 '22 21:09

Tigraine