'C# (.Net5.0) Project uses System.Media.SystemSounds, but VS2019 says I now need to use System.Windows.Extensions.SystemSounds (.Net7.0)
As the headline says, I have an existing .Net5.0 C# project that uses the System.Media.SystemSounds class, but VS2019 has suddenly started throwing the error:
Error CS1069: The type name 'SystemSounds' could not be found in the namespace 'System.Media'. This type has been forwarded to assembly 'System.Windows.Extensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' Consider adding a reference to that assembly.
I've found this new module (System.Windows.Extensions) in Nuget, and applied it to my project, but it doesn't appear, and I'm still getting the error.
I assume that this is because the project itself is still targeted to .Net5.0 but the dependencies for System.Windows.Extensions say it needs the .Net7.0 class System.Drawing.Common The problem being that I can't find how to add even .Net6.0 support to Visual Studio 2019, let alone 7.0, so I don't know how to get my project to compile anymore?
Can someone point me towards a solution for either forcing VS2019 to use the (apparently deprecated) System.Media.SystemSounds class, or tell me how to enable/activate/apply .Net7.0 and activate the new System.Windows.Extensions features?
Solution 1:[1]
First from this page we can see that the System.Media.Systemsounds class is in System.Windows.Extensions.dll.
When you install System.Windows.Extensions from nuget you can choose the version on the left.

This page shows 'System.Windows.Extensions 6.0.0' is compatible with .net 6.0, you can update to VS2022 to use .net 6.0.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jingmiao Xu-MSFT |
