Skip to content

Consider marking net5.0 obsoleted APIs obsolete in downlevel targets for OOB packages #43484

Closed

Description

@jeffhandley

Many APIs are being obsoleted in .NET 5. During the PR review for marking those obsoletions, the question was raised for whether or not we should apply the obsoletions to OOB packages with downlevel targets such as netstandard2.0 and netcoreapp2.0.

This was an explicit non-goal of better obsoletions, but it's worth further consideration.

If we determine that we should indeed apply the obsoletions to downlevel targets, then we would need to:

  1. Extract the list of downlevel-targeted APIs from the obsoletions in .NET 5
  2. Decide if we want to apply a downlevel [Obsolete] attribute without the DiagnosticId/UrlFormat properties, apply an [Obsolete] attribute without those properties (triggering CS0618), or implement compiler support for internally-defined System.Obsolete attributes with the new properties.

Activity

  1. transferred this issue fromdotnet/designson Oct 16, 2020
  2. Dotnet-GitSync-Bot commented on Oct 16, 2020

    @Dotnet-GitSync-Bot
    Collaborator

    I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

  3. added
    untriaged
    on Oct 16, 2020
  4. stephentoub commented on Oct 16, 2020

    @stephentoub
    Member

    Extract the list of downlevel-targeted APIs from the obsoletions in .NET 5

    This is specifically referring to APIs we actively ship from dotnet/runtime in nuget packages that have downlevel assets? I'd expect the list of obsoletions there to be very small (or empty?). Do you have some examples?

  5. self-assigned this
    on Jan 8, 2021
  6. removed
    untriaged
    on Jan 8, 2021
  7. added this to the 6.0.0 milestone on Jan 8, 2021
  8. jeffhandley commented on Apr 23, 2021

    @jeffhandley
    MemberAuthor

    As part of #51721, I reviewed the APIs that were conditionally obsoleted only in net5.0+, and the set was limited to System.Security.Permissions and System.Reflection.MetadataLoadContext. The value of obsoleting these down-level is low and it would introduce possible breaking changes upstack. Those obsoletions will not be applied down-level.

    With #51595 though, the obsoletion documentation now makes it clearer and easier to obsolete APIs down-level going forward.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions