79782036

Date: 2025-10-03 17:52:43
Score: 0.5
Natty:
Report link

Coming to this in 2025, using Visual studio 2022, I'd like to add information about how to configure VS WPF project so the Microsoft.Toolkit.Uwp.Notifications NuGet package installs properly.

'Target OS version' for the project has to be set to '10.0.17763.0' or higher. [1]

Problem
By default .NET WPF app project, created in VS 2022, targeting any version of .NET framework, including .NET 8.0 and 9.0, has 'Target OS version' set to 7.0. (Meaning Windows 7 ?)
That informs the UWP NuGet package to not install some needed libs that would only function under Windows 10.

Solution
'Target OS version' can be changed

A. in Visual studio > project properties > Application tab > Target OS version

B. by manually editing project file (.csproj) and changing

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    ..
    <TargetFramework>  THIS PART  </TargetFramework>

to netX.Y-windows10.0.17763.0 [2] where

For example, for project using .NET 8.0 the whole section will be <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>

After the 'Target OS version' change, the NuGet package can be properly installed with all the required libs so examples in this tutorial will work.

If the NuGet package was already installed prior to 'Target OS version' change, it needs to be completely uninstalled and reinstalled.


  1. This means that the project and resulting assemblies are expected to only run under Windows 10, build '10.0.17763.0' or higher. And so they can support features of that version of Windows. Like 'Toast notifications' AKA 'App notifications'.

  2. The net8.0-windows10.0.17763.0 text chunk is also called 'Target Framework Moniker' or 'TFM'.
    Mentioned, but not explained, by the tutorial.

Reasons:
  • Blacklisted phrase (1): this tutorial
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Riva