How to build WinUI 3 application using .NET 7

Andrew Fraser 91 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 App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
725 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,636 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) 55,601 Reputation points
    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