非預設診斷識別碼的 API 淘汰 (.NET 10)
從 .NET 10 開始,某些 API 已標示為過時。 此項重大變更僅適用於已標示為過時且具有自訂診斷標識符的 API
變更描述
在舊版 .NET 中,可以使用這些 API,而不需要任何建置警告。 在 .NET 10 和更新版本中,使用這些 API 會產生具有自定義診斷標識碼的編譯時期警告或錯誤。 使用自訂診斷 ID 讓您可以單獨抑制已過時警告,而不是全面抑制所有已過時警告。
下表列出已淘汰 API 的自定義診斷標識碼及其對應的警告訊息。
診斷標識碼 | 描述 | 嚴重性 |
---|---|---|
SYSLIB0058 |
KeyExchangeAlgorithm 的 KeyExchangeStrength 、CipherAlgorithm 、CipherAlgorithmStrength 、HashAlgorithm 、HashStrength 和 SslStream 屬性已經過時。 請改用 NegotiatedCipherSuite。 |
警告 |
SYSLIB0059 | 在程序結束之前,SystemEvents.EventsThreadShutdown 回呼不會被執行。 請改用 AppDomain.ProcessExit。 | 警告 |
SYSLIB0060 | System.Security.Cryptography.Rfc2898DeriveBytes 建構函式已經過時。 請改用 Rfc2898DeriveBytes.Pbkdf2。 | 警告 |
引進的版本
.NET 10
破壞性變更類型
這些過時可能會影響 源碼相容性。
建議的動作
使用警告上提供的 URL 連結,遵循針對每個診斷識別碼提供的特定指引。
這些過時類型或成員的警告或錯誤不能使用標準診斷標識碼來抑制;請改用自定義
SYSLIBxxxx
診斷標識碼。
受影響的 API
SYSLIB0058
- System.Net.Security.SslStream.KeyExchangeAlgorithm
- System.Net.Security.SslStream.KeyExchangeStrength
- System.Net.Security.SslStream.CipherAlgorithm
- System.Net.Security.SslStream.CipherStrength
- System.Net.Security.SslStream.HashAlgorithm
- System.Net.Security.SslStream.HashStrength
- System.Security.Authentication.ExchangeAlgorithmType
- System.Security.Authentication.CipherAlgorithmType
- System.Security.Authentication.HashAlgorithmType
SYSLIB0059
SYSLIB0060
- System.Security.Cryptography.Rfc2898DeriveBytes
- System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2
另請參閱
- 使用非預設診斷ID的API 廢棄 (.NET 9)
- 具有非預設診斷標識碼的 API 抹去識別碼 (.NET 8)
- .NET 5+ 中的過時功能