Remove NET9_0_OR_GREATER and NET10_0_OR_GREATER preprocessor constants#122953
Conversation
|
Tagging subscribers to this area: @dotnet/area-meta |
…oreLib Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
|
@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? |
I searched for |
|
@copilot, there are build failures, e.g. |
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
…hared files Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
... Fixed in 156bd27. The issue was that files like |
…nstead of NET10_0_OR_GREATER Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
|
@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 <2642209+stephentoub@users.noreply.github.com>
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.