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

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

更改描述

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