參考組件中的參數名稱已變更

部分參考組件參數名稱已改變,以與實作組件中的參數名稱相符。

變更描述

在舊版 .NET 中,有些參考組件參數名稱與其實作組件中對應的參數不同。 這個現象會在使用具名引數和反映時造成問題。

在 .NET 5 中,這些不相符的參數名稱在參考組件中獲得更新,可確實符合實作組件內對應的參數名稱。

下表顯示變更的 API 和參數名稱。

API 舊的參數名稱 新的參數名稱
CodeGenerator.GenerateStatements(CodeStatementCollection) stms stmts
Icon.ISerializable.GetObjectData(SerializationInfo, StreamingContext) info si
Image.ISerializable.GetObjectData(SerializationInfo, StreamingContext) info si
IPAddress.Parse(ReadOnlySpan<Char>) ipString ipSpan
IPAddress.TryParse(ReadOnlySpan<Char>, IPAddress) ipString ipSpan
IsolatedStorageFileStream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) buffer array
IsolatedStorageFileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) buffer array
NetworkCredential.GetCredential(String, Int32, String) authType authenticationType
ParenthesizePropertyNameAttribute.Equals(Object) o obj
RefreshPropertiesAttribute.Equals(Object) value obj
StackFrame(Boolean) fNeedFileInfo needFileInfo
StackFrame(Int32, Boolean) fNeedFileInfo needFileInfo
StringNormalizationExtensions.IsNormalized(String, NormalizationForm) value strInput
StringNormalizationExtensions.IsNormalized(String) value strInput
StringNormalizationExtensions.Normalize(String, NormalizationForm) value strInput
StringNormalizationExtensions.Normalize(String) value strInput

變更原因

參數名稱變更的原因是為了保持一致性,以及避免在使用具名引數和反映時失敗。

導入的版本

5.0

如果您因參數名稱改變而遭遇編譯器錯誤,請據此更新參數名稱。

受影響的 API