Possible Duplicate:
Embedding DLLs in a compiled executable
I want to compile my C# application to a single exe file. The problem is that my project depends on many other projects resulting in many dlls in the Release
folder when I compile it. Is there any way to just make an exe with these dlls included?
Note: It does not need to be independent from the .NET framework. I assume that anyone using this exe will have that installed.
.NET ships with a tool called ILMerge where multiple assemblies can be packaged together into a single file. You would use it like:
ilmerge /target:winexe /out:myoneexecutable.exe Foo.exe Bar1.dll Bar2.dll
ILMerge is one option, but it can't merge WPF assemblies. You can embed assemblies as resources and dynamically load them. See this Richter article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With