Skip to content

Developers can follow documentation to resolve Platform Compatibility warnings #44919

Open

Description

@jeffhandley
Original issue description

The Platform Compatibility Analyzer was introduced in .NET 5.0, raising new diagnostics when APIs are referenced that are unsupported on targeted platforms. These diagnostic messages result in build warnings, but there are no corresponding code fixers in place to automatically address the warnings or illustrate how to do so. Instead, developers must turn to the documentation for the analyzer and the CA1416 diagnostic ID to determine how to handle the warnings.

There are multiple ways to handle the warnings, and each of these could be supplied a possible fixer.

  1. Guard platform-specific APIs with guard methods
  2. Mark call site as platform-specific
  3. Assert the call-site with platform check
  4. Suppress the warning

When developers encounter warnings from the Platform Compatibility analyzer, they can be uncertain which approach is best for resolving the warnings. To aide them we will collect our own best practices and document how we've decided to use each remediation approach in our own code base.

  • Review and document the patterns and practices that are emerging within the runtime code
  • Categorize the patterns into scenarios such that we can document refined guidance for when to use each pattern

Activity

  1. added
    code-fixer
    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:1
    and removed
    untriaged
    on Nov 19, 2020
  5. changed the title [-]Implement Code Fixers for Platform Compatibility warnings[/-] [+]Developers have easy way to resolve Platform Compatibility warnings[/+] on Nov 27, 2020
  6. added
    User Story
    on Nov 27, 2020
  7. added
    Cost:M
    on Jan 14, 2021
  8. changed the title [-]Developers have easy way to resolve Platform Compatibility warnings[/-] [+]Developers can easily resolve Platform Compatibility warnings with a code fixer[/+] on Jan 21, 2021
  9. added
    help wanted
    on Apr 5, 2021
  10. removed
    code-fixer
    on Apr 21, 2021
  11. 9 remaining items

  12. changed the title [-]Developers can easily resolve Platform Compatibility warnings with a code fixer[/-] [+]Developers can follow documentation to resolve Platform Compatibility warnings[/+] on Jan 22, 2022
  13. added
    documentation
    Cost:S
    Priority:3
    and removed
    code-fixer
    Cost:M
    Priority:1
    on Jan 22, 2022
  14. modified the milestones: Future, 7.0.0 on Jan 22, 2022
  15. modified the milestones: 7.0.0, Future on Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cost:SPriority:3Team:LibrariesUser Storyarea-Metadocumentation

    Type

    No type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions