Parameter names changed in .NET 6

Some parameter names have changed to be consistent between reference and implementation assemblies. Most of the changes are in the reference assemblies, but a handful are in the implementation assemblies.

Previous behavior

Some reference assembly parameter names were different to their corresponding parameters in the implementation assembly. This can cause problems while using named arguments and reflection.

New behavior

In .NET 6, these mismatched parameter names were updated to be consistent across the reference and implementation assemblies.

The following table shows the APIs and parameter names that changed. In addition, some parameter names on Stream-derived types were changed.

API Old parameter name New parameter name Where changed
Attribute.GetCustomAttributes(MemberInfo, Type) type attributeType Reference and implementation assembly
Attribute.GetCustomAttributes(MemberInfo, Type, Boolean) type attributeType Reference and implementation assembly
Strings.InStr(Int32, String, String, CompareMethod) StartPos Start Reference assembly
SortedList<TKey,TValue>.ICollection.CopyTo(Array, Int32) arrayIndex index Reference assembly
Vector.Narrow source1, source2 low, high Reference assembly
Vector.Widen dest1, dest2 low, high Reference assembly
StreamWriter.WriteLine(ReadOnlySpan<Char>) value buffer Implementation assembly
FileStream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) array, numBytes buffer, count Implementation assembly
FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) array, numBytes buffer, count Implementation assembly
MemoryStream.Read(Span<Byte>) destination buffer Reference assembly
MemoryStream.ReadAsync(Memory<Byte>, CancellationToken) destination buffer Reference assembly
MemoryStream.Write(ReadOnlySpan<Byte>) source buffer Reference assembly
MemoryStream.WriteAsync(ReadOnlyMemory<Byte>, CancellationToken) source buffer Reference assembly
UnmanagedMemoryStream.Read(Span<Byte>) destination buffer Reference assembly
UnmanagedMemoryStream.Write(ReadOnlySpan<Byte>) source buffer Reference assembly
SignerInfo.AddUnsignedAttribute(AsnEncodedData) asnEncodedData unsignedAttribute Reference assembly
SignerInfo.RemoveUnsignedAttribute(AsnEncodedData) asnEncodedData unsignedAttribute Reference assembly
Rfc3161TimestampRequest.ProcessResponse(ReadOnlyMemory<Byte>, Int32) source responseBytes Implementation assembly
Rfc3161TimestampToken.TryDecode(ReadOnlyMemory<Byte>, Rfc3161TimestampToken, Int32) source encodedBytes Implementation assembly
Rfc3161TimestampTokenInfo.Rfc3161TimestampTokenInfo(Oid, Oid, ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>, DateTimeOffset, Nullable<Int64>, Boolean, Nullable<ReadOnlyMemory<Byte>>, Nullable<ReadOnlyMemory<Byte>>, X509ExtensionCollection) tsaName timestampAuthorityName Implementation assembly
Rfc3161TimestampTokenInfo.TryDecode(ReadOnlyMemory<Byte>, Rfc3161TimestampTokenInfo, Int32) |
PrincipalPermission.Equals(Object) o obj Reference assembly
UrlMembershipCondition.Equals(Object) o obj Reference assembly
DBDataPermission(DBDataPermission) dataPermission permission Implementation assembly
DBDataPermission(DBDataPermissionAttribute) attribute permissionAttribute Implementation assembly
DBDataPermission(PermissionState, Boolean) blankPassword allowBlankPassword Implementation assembly
DBDataPermission.FromXml(SecurityElement) elem securityElement Implementation assembly
DBDataPermission.Union(IPermission) other target Implementation assembly

Reason for change

  • In cases where the reference assembly parameter names were changed, the new names were deemed more appropriate or readable and minimally breaking.
  • In cases where the names of runtime parameters were changed to gain consistency across platforms or with reference assemblies, the runtime implementation now matches the public API and documentation for the method.

Version introduced

.NET 6

If you encounter a compiler error due to a parameter name change, update the parameter name accordingly.

If you use run-time reflection to inspect methods and took a dependency on the parameter names, update the code to use the new parameter names.

Affected APIs

See also