The target framework of my project is set to net5.0-windows.
A C# file contains a call to Microsoft.Win32.Registry.SetValue() which gives me the following warning:
warning CA1416: 'Registry.SetValue(string, string?, object, RegistryValueKind)' is supported on 'windows'
Why do I get this warning if my project is set to net5.0-windows?
Update: What is the proper way to handle error CA1416 for .NET core builds? as pointed out by pavel-anikhouski does not fix the problem.