默认情况下,这个错误只对面向 .NET 5 或更高版本的项目
处理方法:添加属性说明
[SupportedOSPlatform("linux")] // An API supported only on Linux.
// API is supported on Windows, iOS from version 14.0, and MacCatalyst from version 14.0.
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("ios14.0")] // MacCatalyst is a superset of iOS, therefore it's also supported
[UnsupportedOSPlatform("windows")] //不支持
[UnsupportedOSPlatform("android")] //An API not supported on Android but supported on all other platforms.