How to build WinUI 3 application using .NET 7

Andrew Fraser 161 Reputation points
2023-03-29T18:25:14.8133333+00:00

If I create a blank WinUI 3 desktop application with VS2022 Preview in Windows 10 x64, it targets .NET 5 and I immediately get warnings:

Package 'Microsoft.ProjectReunion.InteractiveExperiences 0.8.12' was restored using 'net5.0-windows10.0.19041, .NETCoreApp,Version=v3.1, .NETCoreApp,Version=v3.0, .NETCoreApp,Version=v2.0, .NE.....```

and

The target framework 'net5.0-windows10.0.19041.0' is out of support and will not receive security updates in the future.

So I choose to target .NET 7 and get lots of errors including:

Package Microsoft.ProjectReunion.InteractiveExperiences 0.8.12 is not compatible with net7.0 

How do I target .NET 7?

Andy

Windows development | Windows App SDK
Developer technologies | C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 90,681 Reputation points
    2023-03-29T19:14:29.35+00:00

    0.8 is a very old version

    Did you install Visual Studio project and item templates ?

    Did you install same versions for Microsoft.WindowsAppSDK Nuget Package and Runtimes ?

    (https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/release-channels)

    On my PC, I use 1.1.0, not the last one, and it works with Unpackaged App, with :

    <TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>

    <WindowsPackageType>None</WindowsPackageType>

    (and the forum for WinUI 3 is https://learn.microsoft.com/en-us/answers/tags/184/windows-app-sdk)

    1 person found this answer helpful.

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-03-29T18:59:16.39+00:00

    the project reunion was retired and only supports .net 5. it has been replaced by:

    https://github.com/microsoft/WindowsAppSDK

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.