How to fix Visual Studio 2022 Warning CA1416 “Call site reachable by all platforms” but “only supported on: ‘windows'”?
I had success removing the CA1416 warnings by adding the following decorator to the top of the containing class: [System.Runtime.Versioning.SupportedOSPlatform(“windows”)] I’m only on VS2019 and using .net 5, but it may work for you. I tried this with VS2019 .net5 console project (top of class Program) and a .net5 class library (top of the class). … Read more