amateur
amateur

Reputation: 44605

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?

Upvotes: 5

Views: 1741

Answers (4)

Yogesh Jadhav
Yogesh Jadhav

Reputation: 11

 1. Select Configuration Manager and check parameter such as debug/release or x86/new.
    2.Select Release instead of debug from drop down menu near debug button(Visual studio framework).
    3. Click on build and then build yourApplicationName.
    4. Goto Your program folder->bin->release->yourApplicationName.exe.
    5. yourApplicationName.exe is ready to use.
    Thanks

Upvotes: -2

Yogesh Jadhav
Yogesh Jadhav

Reputation: 11

Go to Your Application->bin->dubug->yourapplicationname.exe It is automatically generated but exe from release folder is more faster than the debug due to less information of debug.

Upvotes: -3

Yahia
Yahia

Reputation: 70369

As posted ILMerge is one option, another is "SmartAssembly" from RedGate etc.

What all these DO NOT do is internalizing native DLLs - that's a limitation in the Windows API... so any dependency which is a native DLL has to be shipped along with the EXE.

Upvotes: 1

Tigraine
Tigraine

Reputation: 23648

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.

Upvotes: 9

Related Questions