question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run WinUI 3 in desktop(C#) after updating toolset

See original GitHub issue

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)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
huoyaoyuancommented, Sep 1, 2020

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

1reaction
Scottj1scommented, Jul 21, 2020

Closing this issue as both symptoms have been resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Combine C++ WinUI 3 and Win32 Desktop ...
Hi I'm trying to combine WinUI 3 and Win32 desktop application (C++) ... when I try to open the generated EXE file which...
Read more >
A deep-dive into WinUI 3 in desktop apps - Windows Blog
In this blog post I'm going to focus on building a desktop app with WinUI 3 Preview 1 and .NET, leaving C++ for...
Read more >
Error opening XAML page in designer in a WinUI 3 ...
1 Answer 1 ... WinUI 3 doesn't have a XAML designer and doesn't work with Blend. There's a ongoing discussion in the repo...
Read more >
Building Modern Desktop Apps with .NET and C - WinUI 3.0
NET Windows Developers to build a desktop application with C#. ... WinUI 3.0 is an evolution of the UWP XAML framework.
Read more >
Exe published from default WinUI 3/Windows App SDK ...
However, when I publish my app, I get an error message when I run Setup.exe. This states: "Cannot continue. The application is improperly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found