microsoft-ui-xaml: WinUI in VS 2019 Preview gives error "... requires WinRT.Runtime.dll version 1.2 or greater" and more

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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@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>

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 =)