Desktop Bridge on .NET 5 forces "self-contained mode"

David Rickard 1 Reputation point
2021-03-06T07:36:22.227+00:00

I have a .NET 4.7.1 WPF app that I'm distributing through Desktop Bridge. I'm working on porting this to .NET 5. When I package the application it insists on adding <RuntimeIdentifier>win-x64</RuntimeIdentifier> to my executables, and when I do this I get a ton of extra DLLs in my output directory, like it's building in self-contained mode. For example:

api-ms-win-core-console-l1-1-0.dll
Microsoft.VisualBasic.dll
PresentationCore.dll
PresentationFramework.Aero.dll
PresentationFramework.Aero2.dll
PresentationFramework.AeroLite.dll
PresentationFramework.Classic.dll
PresentationFramework.dll
PresentationFramework.Luna.dll
PresentationFramework.Royale.dll
...

And dozens of others. Is there a way to get Desktop Bridge + WPF + .NET 5 working nicely together in framework-dependent mode?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,861 Reputation points
    2021-03-08T06:19:41.543+00:00

    Hello, Welcome to Micorosoft Q&A,

    Desktop Bridge on .NET 5 forces "self-contained mode"

    Currently, Net5 clickonce package and self-contained are not flawless, you could find the related issue in Github here. For your scenario, we suggest you edit your WPF project target framework to .NET 5, and package it with Windows application package project. Then build UWP sideload package. Or use WinUI3 project templates to make Bank app, Packaged project directly.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments