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.

WinUI in VS 2019 Preview gives error "... requires WinRT.Runtime.dll version 1.2 or greater" and more

See original GitHub issue

Describe the bug Unable to build “Blank App, Packaged (WinUI 3 in Desktop)”. The error list contains:

This version of Project Reunion requires WinRT.Runtime.dll version 1.2 or greater. Please update to .NET 5.0.6 SDK or later. Or add a temporary Microsoft.Windows.SDK.NET.Ref FrameworkReference of version > 10.0.*.16 or later.

I also note that I have yellow triangles in the Dependencies regarding the WinUI, see below.

Steps to reproduce the bug

  1. I installed the VS 2019 Preview from microsofts webpage, version is Version 16.10.0 Preview 2.1
  2. I followed the instructions here: https://docs.microsoft.com/en-us/windows/apps/project-reunion/get-started-with-project-reunion#set-up-your-development-environment and here https://docs.microsoft.com/en-us/windows/apps/winui/winui3/get-started-winui3-for-desktop to setup Reunion
  3. Open VS2019 Preview, create new Project "“Blank App, Packaged (WinUI 3 in Desktop)”
  4. Build

Expected behavior I expected the app to build and run, with no apparent errors.

What happened instead In step 5 here: https://docs.microsoft.com/en-us/windows/apps/winui/winui3/get-started-winui3-for-desktop, after clicking OK, I get this error message: image

After clicking OK in that error popup, the project loads, and I can see errors in the dependencies: image

I also note that the “Windows Application Packaging Project” that is supposed to be created (according to the URL above), is not created.

Version Info WinUI packages version: 0.5.5 Windows app type: desktop OS: Win 10 20H2 build 19042.928

NuGet package version: See above.

Windows app type: Ehm, I am not sure. It says “Output type: Window Application”, so I guess Win32?

UWP Win32
? Yes
Windows 10 version Saw the problem?
October 2020 Update (19042) Yes
Device form factor Saw the problem?
Desktop Yes

Additional context I have used the maui-check tool, and that says that everything is OK:

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
codendonecommented, Apr 30, 2021

@AghaKhan Did you try the option of adding this block in your .csproj file?

<ItemGroup>
    <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
    <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
</ItemGroup>
1reaction
tedekerothcommented, Apr 27, 2021

Yes, that worked. I was very confused from this thread here, where I thought they said that it is not the package project that should be started:

As a sanity check, the app being debugged doesn’t have “Package” in the name, which is the default for packaging projects (e.g. “ETIHub.TDHub.Demo.UI (Package)” instead of “ETIHub.TDHub.Demo.UI”). @s3nt1n3l-hub can you confirm the wapproj/packaging project is being run instead of the unpackaged application?

That sounded to me that Packaging shouldn’t be run. Apparently, I misread of they said the wrong thing.

Thanks for your input asklar =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preview channel release notes for the Windows App SDK
NET SDK version, you will see an error like: "This version of WindowsAppSDK requires . NET 6+ and WinRT. Runtime. dll version 2.0...
Read more >
WinUI 3.0 for desktop apps default project gives runtime error
I ran into this issue as well, updating .NET 5 SDK to preview 6 solved it for me.
Read more >
Building Modern Desktop Apps with .NET and C - WinUI 3.0
This is an online event organized by the .NET Zurich User Group. Abstract: There are many choices for .NET Windows Developers to build...
Read more >
A deep-dive into WinUI 3 in desktop apps - Windows Blog
This interop code uses the winrt.runtime.dll library. As you can guess, the cswinrt.exe gets all the WinUI WinMD files and generates C# interop ......
Read more >
WinUI System Requirements - Telerik UI for WinUI
Learn what system requirements you need to provide when using any of the installation approaches for the Telerik UI for WinUI library.
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