-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing API compat issues between ref/src for attributes on properties #68432
Conversation
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
@@ -1577,6 +1577,7 @@ public enum SchemaType | |||
public enum SerializationFormat | |||
{ | |||
Xml = 0, | |||
[System.ObsoleteAttribute("SerializationFormat.Binary is obsolete and should not be used. See https://aka.ms/serializationformat-binary-obsolete for more information.", DiagnosticId = "SYSLIB0038")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change: it was already made in the src but never shipped in references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine. We already have obsolete attributes regarding binary formatter in various places; it seems we simply missed this occurrence. However, given this is in System.Data
, it might be a very different scenario. /cc @roji @ajcvickers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we did this recently in #39289 as part of obsoleting (and eventually removing) all uses of BinaryFormatter, for 7.0 (so hasn't shipped yet). It's indeed being treated and documented as a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Net.* changes LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the mono build break, LGTM.
I've used the patch file to get to a quick summary of all new attributes: All attribute additions[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value) instead.")]
[Obsolete("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[Obsolete("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[Obsolete("IPAddress.Address is address family dependent and has been deprecated. Use IPAddress.Equals to perform comparisons instead.")]
[Obsolete("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize instead.")]
[Obsolete("IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant. To get the maximum size use IsolatedStorageFile.Quota instead.")]
[Obsolete("Marshalling arbitrary types may be unavailable in future releases. Specify the type you wish to marshal as.")]
[Obsolete("Marshalling as AnsiBStr may be unavailable in future releases.")]
[Obsolete("Marshalling as Currency may be unavailable in future releases.")]
[Obsolete("Marshalling as TBstr may be unavailable in future releases.")]
[Obsolete("Marshalling as VBByRefString may be unavailable in future releases.")]
[Obsolete("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")]
[Obsolete("PerformanceCounter.DefaultFileMappingSize has been deprecated and is not used. Use machine.config or an application configuration file to set the size of the PerformanceCounter file mapping instead.")]
[Obsolete("PerformanceCounterManager has been deprecated. Use the PerformanceCounters through the System.Diagnostics.PerformanceCounter class instead.")]
[Obsolete("Process.NonpagedSystemMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.NonpagedSystemMemorySize64 instead.")]
[Obsolete("Process.PagedMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PagedMemorySize64 instead.")]
[Obsolete("Process.PagedSystemMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PagedSystemMemorySize64 instead.")]
[Obsolete("Process.PeakPagedMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PeakPagedMemorySize64 instead.")]
[Obsolete("Process.PeakVirtualMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PeakVirtualMemorySize64 instead.")]
[Obsolete("Process.PeakWorkingSet has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PeakWorkingSet64 instead.")]
[Obsolete("Process.PrivateMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.PrivateMemorySize64 instead.")]
[Obsolete("Process.VirtualMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.VirtualMemorySize64 instead.")]
[Obsolete("Process.WorkingSet has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.WorkingSet64 instead.")]
[Obsolete("ReflectionPermissionAttribute.ReflectionEmit has been deprecated and is not supported.")]
[Obsolete("ReflectionPermissionAttribute.TypeInformation has been deprecated and is not supported.")]
[Obsolete("ReflectionPermissionFlag.AllFlags has been deprecated. Use PermissionState.Unrestricted to get full access.")]
[Obsolete("ReflectionPermissionFlag.ReflectionEmit has been deprecated and is not supported.")]
[Obsolete("ReflectionPermissionFlag.TypeInformation has been deprecated and is not supported.")]
[Obsolete("RegistryPermissionAttribute.Add has been deprecated. Use ViewAndModify instead.")]
[Obsolete("SecurityProtocolType.Ssl3 has been deprecated and is not supported.")]
[Obsolete("SerializationFormat.Binary is obsolete and should not be used. See https://aka.ms/serializationformat-binary-obsolete for more information.", DiagnosticId = "SYSLIB0038")]
[Obsolete("StandardEventKeywords.CorrelationHint has an incorrect value and has been deprecated. Use CorrelationHint2 instead.")]
[Obsolete("The ApartmentState property has been deprecated. Use GetApartmentState, SetApartmentState or TrySetApartmentState instead.")]
[Obsolete("vbNewLine has been deprecated. For a carriage return and line feed, use vbCrLf. For the current platform's newline, use System.Environment.NewLine."]
[Obsolete("WaitHandle.Handle has been deprecated. Use the SafeWaitHandle property instead.")]
[RequiresAssemblyFiles("Returns <Unknown> for modules with no file path")]
[RequiresAssemblyFiles("This member throws an exception for assemblies embedded in a single-file app")]
[SupportedOSPlatform("maccatalyst")]
[UnsupportedOSPlatform("freebsd")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("osx")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("tvos")] These are the types:
|
src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs
Show resolved
Hide resolved
This will allow us to ensure the codebase is ready to ingest the arcade fix to ApiCompat.
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsAPI compat had a regression about a year ago where it stopped checking attributes on members other than methods. dotnet/arcade#9168 fixes that. This PR brings us back up to date. Marking this breaking because one member was missing obsolete in the ref assembly.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for the System.Data.Common.Tests build failures.
This was introduced by dotnet/runtime#68432. We need to mark the test as not runnable on the platforms where we are missing this property
This was introduced by dotnet/runtime#68432. We need to mark the test as not runnable on the platforms where we are missing this property
Doc was created in dotnet/docs#28726 and is published as https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/7.0/serializationformat-binary |
API compat had a regression about a year ago where it stopped checking attributes on members other than methods. dotnet/arcade#9168 fixes that. This PR brings us back up to date.
Marking this breaking because one member was missing obsolete in the ref assembly.