Remove NET9_0_OR_GREATER and NET10_0_OR_GREATER preprocessor constants#122953
Remove NET9_0_OR_GREATER and NET10_0_OR_GREATER preprocessor constants#122953stephentoub merged 9 commits intomainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/area-meta |
…oreLib Co-authored-by: stephentoub <[email protected]>
Co-authored-by: stephentoub <[email protected]>
|
@copilot, what about NET8_0_OR_GREATER, NET7_0_OR_GREATER, NET6_0_OR_GREATER, etc. Any of those that also need to be cleaned up? |
src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs
Outdated
Show resolved
Hide resolved
I searched for |
|
@copilot, there are build failures, e.g. |
Co-authored-by: stephentoub <[email protected]>
…hared files Co-authored-by: stephentoub <[email protected]>
... Fixed in 156bd27. The issue was that files like |
…nstead of NET10_0_OR_GREATER Co-authored-by: stephentoub <[email protected]>
Co-authored-by: stephentoub <[email protected]>
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor_1.cs
Show resolved
Hide resolved
Co-authored-by: MihaZupan <[email protected]>
|
@copilot, please search the repo for any remaining NET9_0_OR_GREATER or NET10_0_OR_GREATER constants in any files. |
Co-authored-by: stephentoub <[email protected]>
Found and fixed 18 remaining occurrences in test files (commit 6a4b0e8):
All replaced with |
@copilot, are there remaining uses elsewhere than src/libraries? |
No, there are no remaining occurrences anywhere in the repo. I searched the entire repository (excluding |
Cleanup of .NET Version Constants
The repo no longer builds for .NET Core versions older than 10. This PR removes obsolete version-specific preprocessor constants (
NET9_0_OR_GREATER,NET10_0_OR_GREATER).Strategy
For files that only build for .NET 10+ runtime (System.Private.CoreLib):
#if NET9_0_OR_GREATER/#if NET10_0_OR_GREATERwith#if NETMicrosoft.Bcl.AsyncInterfaceswhich target netstandard/netframeworkFor files in
netcoredirectories or ending innetcore.cs:#if NETchecks are removed entirely and code is made unconditional#ifdirectivesFor other files that also build for netstandard/netframework:
NET9_0_OR_GREATER/NET10_0_OR_GREATERwith justNET#if NET ... #else ... #endifstructureFor test files:
NET9_0_OR_GREATER/NET10_0_OR_GREATERwithNETsince test projects target both .NET Core and .NET FrameworkFiles Changed
Source files:
#if NET ... #elsestructure)Test files:
Note: Searched for older version constants (
NET8_0_OR_GREATER,NET7_0_OR_GREATER,NET6_0_OR_GREATER, etc.) - none were found in the source files.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.