【问题标题】:Why can't I use "SupportedOSPlatform" attribute in my .net Standard 2.0 library?为什么我不能在我的 .net Standard 2.0 库中使用“SupportedOSPlatform”属性?
【发布时间】:2021-04-22 21:43:05
【问题描述】:

为什么我不能在我的 .NET Standard 2.0 库中使用“SupportedOSPlatform”属性?

编译器无法识别此属性。

根据文档:

将调用标记为特定于 Windows。在某些情况下,通过 [SupportedOSPlatform("windows")] 将调用成员标记为特定于平台可能是有意义的。

【问题讨论】:

    标签: .net .net-standard .net-standard-2.0


    【解决方案1】:

    【讨论】:

    • 好的,谢谢。 .net 标准库是否有等效属性?我只是坚持使用条件:OperatingSystem.IsWindows()
    • 我认为你确实需要条件
    猜你喜欢
    • 1970-01-01
    • 2018-06-21
    • 1970-01-01
    • 2011-07-20
    • 1970-01-01
    • 2018-04-29
    • 1970-01-01
    • 2018-10-13
    • 2022-01-16
    相关资源
    最近更新 更多