microsoft-ui-xaml: Cannot run WinUI 3 in desktop(C#) after updating toolset

I confirmed that I can run the template app when it released at Duild. But now, I can neither run the code I created then, nor a blank new template app. The original version I deployed at May can run, so it’s a toolset issue, not an OS issue.

What I’ve done from Build (May 20):

  • Update patch versions of VS(16.6.0->16.6.2, 16.7P1->16.7P2)
  • Install Windows SDK 19041, but haven’t uninstalled 18362
  • Update .NET 5 from Preview 4 to Preview 5

What symptoms I’ve met now:

  • At the default state, deployment of the package project will fail, claims that .NET Framework 4.5.1 target pack is not found. The Universal Windows Development workload of VS requires 4.5, not 4.5.1
  • After manually select and installed the target pack, deployment successes, but the app throws at WinRT.ComWrappersSupport.InitializeComWrappers, as-if it’s running unpacked

I guess the first issue is caused by new Windows SDK, and the second issue is caused by new preview of .NET 5. I don’t want to downgrade them to confirm this. Please consider to update the template version.

The detailed environment of my machine (You can create a new VM and confirm if the template app will fail):

Windows 10 Pro 19041
Visual Studio Enterprise 16.6.2
  - .NET Desktop workload
  - UWP workload, 18362 and 19041 selected
Visual Studio Community 16.7 Preview 2
  - .NET Desktop workload
  - UWP workload, no optional checkbox selected
  - WinUI3 vsix template
.NET 5 SDK Preview 5 x64 (and also the versions come with VS)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 21 (12 by maintainers)

Most upvoted comments

@stevenbrix Thanks, that solves the problem. I always use global.json to specify preview SDK and have nearly forgotten the global switch.

Closing this issue as both symptoms have been resolved