Επεξεργασία

Κοινή χρήση μέσω


API obsoletions with non-default diagnostic IDs (.NET 10)

Some APIs have been marked as obsolete, starting in .NET 10. This breaking change is specific to APIs that have been marked as obsolete with a custom diagnostic ID. Suppressing the default obsoletion diagnostic ID, which is CS0618 for the C# compiler, does not suppress the warnings that the compiler generates when these APIs are used.

Change description

In previous .NET versions, these APIs can be used without any build warning. In .NET 10 and later versions, use of these APIs produces a compile-time warning or error with a custom diagnostic ID. The use of custom diagnostic IDs allows you to suppress the obsoletion warnings individually instead of blanket-suppressing all obsoletion warnings.

The following table lists the custom diagnostic IDs and their corresponding warning messages for obsoleted APIs.

Diagnostic ID Description Severity
SYSLIB0058 The KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm, and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead. Warning
SYSLIB0059 SystemEvents.EventsThreadShutdown callbacks aren't run before the process exits. Use AppDomain.ProcessExit instead. Warning
SYSLIB0060 System.Security.Cryptography.Rfc2898DeriveBytes constructors are obsolete. Use Rfc2898DeriveBytes.Pbkdf2 instead. Warning

Version introduced

.NET 10

Type of breaking change

These obsoletions can affect source compatibility.

  • Follow the specific guidance provided for the each diagnostic ID using the URL link provided on the warning.

  • Warnings or errors for these obsoletions can't be suppressed using the standard diagnostic ID for obsolete types or members; use the custom SYSLIBxxxx diagnostic ID value instead.

Affected APIs

SYSLIB0058

SYSLIB0059

SYSLIB0060

See also