[Breaking change]: Rfc2898DeriveBytes.CryptDeriveKey is marked as Obsolete #25506
Closed
1 of 2 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 6
Issues and PRs for the .NET 6 release
source incompatible
Source code may encounter a breaking change in behavior when targeting the new version.
Description
The
Rfc2898DeriveBytes.CryptDeriveKey
API has been marked as[Obsolete]
. This API has never been supported in .NET Core / .NET 5+ and always throwsPlatformNotSupportedException
.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 throwPlatformNotSupportedException
at runtime.New behavior
Referencing
Rfc2898DeriveBytes.CryptDeriveKey
will produce a build-time warning with diagnostic ID ofSYSLIB0033
. If warnings are treated as errors, then this will cause a build error.Type of breaking change
Reason for change
In .NET 6, we are marking several APIs as
[Obsolete]
if they unconditionally throwPlatformNotSupportedException
. 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
The text was updated successfully, but these errors were encountered: