How to merge a subset of linked dll files with one exe file (C#, WinForms)?

133 Views Asked by At

I have a solution with two C# projects: One WinForms application (exe) and one library (dll). Multiple external dll files are referenced. I would like to merge the output of my projects into one exe file, while keeping the other dll files separately, i.e. instead of

  • myApp.exe
  • myLib.dll
  • externalLib1.dll
  • externalLib2.dll
  • ...

I would like to have

  • myMergedAppAndLib.exe
  • externalLib1.dll
  • externalLib2.dll
  • ...

Is this actually possible? I am aware of the ILMerge tool, but it seems to be deprecated and I don't know whether it is ok not to include all referenced dll files. I am also aware of the publishing option in Visual Studio Produce single file, but to my understanding this will also merge the external dll files, right?

I cannot merge the two projects, because the library project is also used for a third project (another WinForms exe).

Related SO question: merge-dll-into-exe

0

There are 0 best solutions below