API obsoletions with non-default diagnostic IDs (.NET 9)
Some APIs have been marked as obsolete, starting in .NET 9. This breaking change is specific to APIs that have been marked as obsolete with a custom diagnostic ID. Suppressing the default obsoletion diagnostic ID, which is CS0618 for the C# compiler, does not suppress the warnings that the compiler generates when these APIs are used.
Change description
In previous .NET versions, these APIs can be used without any build warning. In .NET 9 and later versions, use of these APIs produces a compile-time warning or error with a custom diagnostic ID. The use of custom diagnostic IDs allows you to suppress the obsoletion warnings individually instead of blanket-suppressing all obsoletion warnings.
The following table lists the custom diagnostic IDs and their corresponding warning messages for obsoleted APIs.
Diagnostic ID | Description | Severity |
---|---|---|
SYSLIB0009 | AuthenticationManager is not supported. Methods will no-op or throw PlatformNotSupportedException. | Warning |
SYSLIB0054 | Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write instead. | Warning |
SYSLIB0055 | AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate* methods with signed parameters are obsolete. Use the unsigned overloads instead. |
Warning |
Version introduced
.NET 9
Type of breaking change
These obsoletions can affect source compatibility.
Recommended action
Follow the specific guidance provided for the each diagnostic ID using the URL link provided on the warning.
Warnings or errors for these obsoletions can't be suppressed using the standard diagnostic ID for obsolete types or members; use the custom
SYSLIBxxxx
diagnostic ID value instead.
Affected APIs
SYSLIB0009
SYSLIB0054
SYSLIB0055
- System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<Int64>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<Int16>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<Int32>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<Int16>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<Int64>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<Int32>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<SByte>, Vector128<Int16>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<Int16>, Vector128<Int32>, Byte)
- System.Runtime.Intrinsics.Arm.AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<Int32>, Vector128<Int64>, Byte)
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for