Remove PlatformDetection.IsWindows7 and IsNotWindows7 properties#122907
Merged
stephentoub merged 20 commits intomainfrom Jan 7, 2026
Merged
Remove PlatformDetection.IsWindows7 and IsNotWindows7 properties#122907stephentoub merged 20 commits intomainfrom
stephentoub merged 20 commits intomainfrom
Conversation
- Remove IsWindows7 and IsNotWindows7 property definitions from PlatformDetection.Windows.cs - Simplify conditional logic that checked IsWindows7 (always false) or IsNotWindows7 (always true) - Update GetAlpnSupport, GetTls11Support, GetTls12Support, GetSendsCAListByDefault in PlatformDetection.cs - Remove IsInAppContainer Windows 7 check - Convert ConditionalTheory/ConditionalFact attributes to regular Theory/Fact where they only checked IsNotWindows7 - Remove early returns in tests that checked IsWindows7 - Simplify ternary expressions that used IsWindows7 - Remove helper properties that depended on IsWindows7 - Remove IsWindows7() method from ConsolePal.Windows.cs - Remove IsWindows7 property from test library Utilities.cs - Update util_nodependencies.cpp to make Windows 8 the minimum supported version Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
…onditionals Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
Copilot
AI
changed the title
[WIP] Remove PlatformDetection.IsWindows7 and IsNotWindows7 properties
Remove PlatformDetection.IsWindows7 and IsNotWindows7 properties
Jan 6, 2026
jkotas
reviewed
Jan 6, 2026
jkotas
reviewed
Jan 6, 2026
jkotas
reviewed
Jan 6, 2026
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/libraries/System.Net.HttpListener/tests/HttpListenerWebSocketTests.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/libraries/System.Net.HttpListener/tests/HttpListenerWebSocketTests.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
...raries/System.Runtime/tests/System.Globalization.Extensions.Tests/IdnMapping/Data/Factory.cs
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/tests/Interop/IJW/NativeCallingManaged/NativeCallingManaged.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 6, 2026
src/tests/Interop/IJW/ManagedCallingNative/ManagedCallingNative.cs
Outdated
Show resolved
Hide resolved
- Delete RUNNING_ON_WIN7 from RunningOnStatusEnum - Update RUNNING_ON_WIN8 value from 2 to 1 - Update comment to reflect Win8 as minimum supported platform Co-authored-by: jkotas <[email protected]>
… test data - Delete GetGdiPlusIsAvailableNotWindows7 method (replaced with GetIsDrawingSupported) - Change SupportsIdna from abstract to virtual with default value true, remove overrides - Delete IsWindows8xOrLater property and replace all usages with IsWindows - Delete IsNotWindows7AndIsWindowsImplementation and replace with Helpers.IsWindowsImplementation - Delete IsWindows8OrLater property and replace with PlatformDetection.IsWindows - Remove Windows 7 specific comments from SslStreamSystemDefaultsTest - Delete Unicode_Win7 test data directory and remove from project files Co-authored-by: jkotas <[email protected]>
Delete #include <versionhelpers.h> from util_nodependencies.cpp since it's no longer needed after removing InitRunningOnVersionStatus() and IsWindows8OrGreater() usage Co-authored-by: jkotas <[email protected]>
This was referenced Jan 6, 2026
Open
Contributor
I know it's not officially supported but it might be worth it to make sure the cleanup doesn't cause any issues with running under Wine/Proton since a lot of apps rely on them, especially in gamedev. |
Member
We (the core .NET team) do not have capacity for this sort of validation. If you care about this, feel free to validate this and report any issue to Wine/Proton to fix. |
jkotas
approved these changes
Jan 6, 2026
jkotas
reviewed
Jan 6, 2026
stephentoub
approved these changes
Jan 6, 2026
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs
Outdated
Show resolved
Hide resolved
Remove redundant case for SslPolicyErrors.RemoteCertificateNotAvailable since it returns false like the default case Co-authored-by: stephentoub <[email protected]>
stephentoub
approved these changes
Jan 6, 2026
Member
|
/ba-g deadletter |
This was referenced Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes
PlatformDetection.IsWindows7andPlatformDetection.IsNotWindows7properties throughout the codebase. Since Windows 7 is no longer supported, these properties always evaluate tofalseandtruerespectively.Key changes:
PlatformDetection.Windows.csandPlatformDetection.csGetTls11Support,GetTls12Support) by removing Windows 7 special casesConsolePal.Windows.csutil_nodependencies.cppto make Windows 8 the minimum supported platform#include <versionhelpers.h>fromutil_nodependencies.cppRunningOnStatusEnumenum definitiongRunningOnStatusglobal variableInitRunningOnVersionStatus()functionRunningOnWin8()function (assumed to always return TRUE)WinRTSupported()function (assumed to always return TRUE)ostype.hfile entirely and movedRunningInWow64()toutilcode.hGetGdiPlusIsAvailableNotWindows7(replaced withGetIsDrawingSupported)IsWindows8xOrLater(replaced withIsWindows)IsNotWindows7AndIsWindowsImplementation(replaced withHelpers.IsWindowsImplementation)IsWindows8OrLater(replaced withPlatformDetection.IsWindows)SupportsIdnaproperty (deleted entirely - always true)Unicode_Win7directory includingIdnaTest_Win7.txtandUnicode_Win7_IdnaTest.cs)System.Globalization.Extensions.Tests.csprojandSystem.Globalization.Extensions.Nls.Tests.csproj)ConditionalTheory/Fact(IsNotWindows7)to regularTheory/FactattributesConditionalTheory/ConditionalFactpatterns to usetypeof(Helpers), nameof(Helpers.IsWindowsImplementation)ortypeof(PlatformDetection), nameof(PlatformDetection.IsWindows)as appropriateIsWindows7,SupportsIdna, orWinRTSupportedServerCertCallbackswitch statement inSslStreamSystemDefaultsTest.csby removing redundant case forSslPolicyErrors.RemoteCertificateNotAvailablethat matched the default behaviorCustomer Impact
None. Windows 7 support was already dropped. This is code cleanup.
Regression
No. This change removes detection for an unsupported platform.
Testing
Existing tests continue to pass. Tests that previously ran conditionally on Windows 8+ now run unconditionally on all Windows versions.
Risk
Low. Changes are purely simplifications based on the invariant that Windows 7 is not supported. No functional behavior changes for supported platforms.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.