引用程序集中的参数名称已更改

某些引用程序集参数名称已更改,以匹配实现程序集中的参数名称。

更改描述

在以前的 .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