Skip to content

[Breaking change]: Rfc2898DeriveBytes.CryptDeriveKey is marked as Obsolete #25506

Closed

Description

@jeffhandley

Description

The Rfc2898DeriveBytes.CryptDeriveKey API has been marked as [Obsolete]. This API has never been supported in .NET Core / .NET 5+ and always throws PlatformNotSupportedException.

Introduced in dotnet/runtime#57002.

Version

.NET 6 RC1

Previous behavior

Referencing Rfc2898DeriveBytes.CryptDeriveKey would not produce any build-time warnings/errors, but it would throw PlatformNotSupportedException at runtime.

New behavior

Referencing Rfc2898DeriveBytes.CryptDeriveKey will produce a build-time warning with diagnostic ID of SYSLIB0033. If warnings are treated as errors, then this will cause a build error.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

In .NET 6, we are marking several APIs as [Obsolete] if they unconditionally throw PlatformNotSupportedException. This allows build-time indication that the API is not supported.

Recommended action

Use PasswordDeriveBytes.CryptDeriveKey instead, per the obsoletion message.

Feature area

Core .NET libraries

Affected APIs

Activity

  1. added
    breaking-change
    on Aug 6, 2021
  2. added
    ⌚ Not Triaged
    🏁 Release: .NET 6
    source incompatible
    on Aug 6, 2021
  3. bartonjs commented on Aug 6, 2021

    @bartonjs
    Member

    @jeffhandley I thought we were just supposed to add things to the checklist in #23856 ?

  4. jeffhandley commented on Aug 6, 2021

    @jeffhandley
    MemberAuthor

    Ah, you're right. We'll get double coverage. :-) I'll update that issue to reflect this, and close this issue. Thanks.

  5. jeffhandley commented on Aug 6, 2021

    @jeffhandley
    MemberAuthor

    Added this to #23856.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 6breaking-changesource incompatible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions