WPF Insert dll into exe

I want to embed a DLL in the EXE of my WPF application so that I actually only have 1 file to distribute, i.e. .EXE. All this material is completely over my head, but I followed the steps described at http://richarddingwall.name/2009/05/14/wpf-how-to-combine-mutliple-assemblies-into-a-single-exe/ , but I still can't get this to work, Any ideas or help on this? So far the DLL is in the same folder as the EXE, but if I delete the DLL, it will fail. However, I do not want the DLL to be present at all, but to be embedded in the EXE. I was looking for other posts here that recommend this solution, but my problem is that everything compiles fine, it just doesn't work, and I don't know how to fix it.

1) I added the appropriate DLL as a resource for the project and set my build method for the embedded resource

2) I added the code specified in the above link to the App.xaml.cs file, as well as using System.Reflection and System.IO

Is there anything I have to do to get this to work?

thanks

Shav

+2
source share
2 answers

You can use ILMerge . We use it all the time to combine the dll into an executable and other libraries.

Here someone else used ILMerge to accomplish this, so this could be seen as a duplicate question.

+1
source

Visual Studio w/Nuget, 'copy local = true' Fody.Costura.

, XML , , ( ).

+1

Source: https://habr.com/ru/post/1713821/


All Articles