Merging dlls into a single .exe with wpf
.NET reactor has the feature of merging the assemblies and its not very expensive.
compiling/merging dll into standalone exe with wpf
Okay, finally had to use the SmartAssembly program.
But still looking for a solution to do it by code.
How to combine DLLs with .exe inside of a wpf / winforms application (with pictures)
If you're using any recent version of .NET Core and Visual Studio, you can use the Publish...
option to include all of your dependencies in the executable.
By default, this only includes DLLs from your solution and not native ones; to include all of the DLLs required to run the project, you have to add 1 line to your csproj
file:
<PropertyGroup>
<!--This is the section that contains <OutputType>, <TargetFramework>, etc.-->
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>
If you don't already have a publish profile created for your project, R+Click on your project in the solution explorer and click Publish...
:
(You can use the Folder option in the publishing window to publish without Azure)
Once you have a publish profile created, click Edit
and make sure you set the deployment mode to Self-Contained
and check the Produce Single File
box:
Merge DLL into EXE?
For .NET Framework 4.5
ILMerge.exe /target:winexe /targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /out:finish.exe insert1.exe insert2.dll
ILMerge
- Open CMD and cd to your directory. Let's say:
cd C:\test
- Insert the above code.
/out:finish.exe
replacefinish.exe
with any filename you want.- Behind the
/out:finish.exe
you have to give the files you want to be
combined.
C# WPF Merge DLL and .exe to one file
In most (all?) C# project files (.csproj
) there is a line near the bottom:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
The blog post was saying you should insert the new lines after that line of the project file. You will need to use a text editor to do this: that part of the project file cannot be altered using the Visual Studio UI.
How to merge files to single executable or decrease the number of distributed files
Take a look at RedGate's SmartAssembly.
How to merge assemblies of a WPF application?
From what I know (and have experienced) ilmerge does not work correctly with WPF assemblies that have xaml resources embedded.
See this question for some possible solutions/alternatives
Related Topics
How Does Hashset Compare Elements for Equality
How to Pass Constructor Parameters to Unity's Resolve() Method
Why New Fb API 2.4 Returns Null Email on MVC 5 with Identity and Oauth 2
What's the Difference Between System.Type and System.Runtimetype in C#
How to Set Up a Web API Controller for Multipart/Form-Data
How Does MVC 4 List Model Binding Work
How to Access Winform Textbox Control from Another Class
How to Indefinitely Pause a Thread
Using Reflection in C# to Get Properties of a Nested Object
Using Image Control in Wpf to Display System.Drawing.Bitmap
How to Implement a Progress Bar Using the Mvvm Pattern
Best Way to Deploy Visual Studio Application That Can Run Without Installing
Implement Validation for Wpf Textboxes
What Are the Benefits to Marking a Field as 'Readonly' in C#
Sometimes Adding a Wcf Service Reference Generates an Empty Reference.Cs