Combing two self-contained applications into one #69569
Replies: 2 comments
-
I don't think so. The files with the same name are probably identical, so there won't be any problem combining them.
A weird workaround I can see: Make the entry points of each program public, add a helper exe referencing them in entry point, trim against the helper exe. |
Beta Was this translation helpful? Give feedback.
-
The publishing should work if you add the RID and self-contained into the projects and make a project reference between the two.
The output of publish of Project B should now contain both exes and everything they need including the runtime/framework. Trimming this setup will not work currently - even if WinUI supported it. We probably don't actively block it (which is wrong) so please be careful. The workaround @huoyaoyuan suggested may probably work (you might not need to make the entry points public and just access them via hardcoded reflection, trimmer should see through it), but I've never tried it. Official support for this would look different, but we currently don't have a plan to add that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've got an application that consists of three parts. A background service, shared library, and foreground (WinUI) app. This application will be distributed as a MSIX.
Currently I
dotnet publish
each app (background and foreground) and combine the results (ignoring duplicate common dlls), then manually package the application usingmakeappx
. All works as expected.To avoid needing to somehow ensure that the .NET 6 Desktop Runtime is installed, I've also tried enabling self-contained for both projects. I
dotnet publish
the two applications, combining the outputs (ignoring all the .net duplicate files). This also works as expected.My question is, will I encounter any weird behaviour doing this? I'm pretty much combining two self contained application together into one folder, ignoring all the files that already exist from Project A. So, in the end it would be something like this:
Project A Output
Project B Output
Combined Output (which is turned into a MSIX)
Obviously, this won't work with trimming (which is not supported with WinUI yet anyway). So any pointers on how I would combine two trimmed self-contained applications into one would be great as well (but not a priority until WinUI supports it, whenever that happens).
Beta Was this translation helpful? Give feedback.
All reactions