简体   繁体   中英

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?

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.

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.

 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM