Skip to content

Developers get warnings when they misuse [SupportedOSPlatform] or [UnsupportedOSPlatform] attributes #44914

Closed

Description

@jeffhandley

The Platform Compatibility Analyzer consumes [SupportedOSPlatform] and [UnsupportedOSPlatform] attributes to report diagnostics when APIs are referenced that are not supported on the targeted platforms. This analyzer and these attributes were introduced in .NET 5.0.

As our platforms expand in .NET 6.0, these attributes will need to be applied on many more APIs and in more complex scenarios. To ensure the attributes are applied correctly, we need to create new diagnostics for missing or invalid attributes.

Here are some examples of when diagnostics should get raised:

Activity

  1. added
    code-analyzer
    on Nov 19, 2020
  2. added this to the 6.0.0 milestone on Nov 19, 2020
  3. added
    untriaged
    on Nov 19, 2020
  4. added
    Priority:0
    and removed
    untriaged
    on Nov 19, 2020
  5. changed the title [-]Introduce diagnostics for missing or invalid [SupportedOSPlatform] and [UnsupportedOSPlatform] attributes[/-] [+]Developers get warnings when they misuse [SupportedOSPlatform] or [UnsupportedOSPlatform] attributes[/+] on Nov 27, 2020
  6. added
    User Story
    on Nov 27, 2020
  7. self-assigned this
    on Dec 17, 2020
  8. added
    Priority:1
    and removed
    Priority:0
    on Jan 11, 2021
  9. danmoseley commented on Jan 11, 2021

    @danmoseley
    Contributor

    This should not be P0 I think as we don't "control" that priority level.

  10. jeffhandley commented on Jan 13, 2021

    @jeffhandley
    MemberAuthor

    Thanks, @danmosemsft. At the time of creating this, @terrajobst and I were using zero-based priorities within Priority:1 issues to indicate that the parent Priority:1 item is unsuccessful without its Priority:0 children. But making this Priority:1 will be cleaner for tracking.

  11. terrajobst commented on Jan 14, 2021

    @terrajobst
    Contributor

    Works for me :-)

    This should not be P0 I think as we don't "control" that priority level.

    My understanding is that you can use that priority but you need to explain to our directors why the product can't ship without them.

  12. added
    Cost:M
    on Jan 14, 2021
  13. buyaa-n commented on May 6, 2021

    @buyaa-n
    Contributor

    Consider warning for misuse of newly added SupportedOSPlatformGuard and UnsupportedOSPlatformGuard attributes

  14. jeffhandley commented on Jul 7, 2021

    @jeffhandley
    MemberAuthor

    I'm closing this based on the original scope. We can file new issues to further improve this experience if needed.

  15. ghost locked as resolved and limited conversation to collaborators on Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Cost:MPriority:1Team:LibrariesUser Storyarea-Metacode-analyzer

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions