-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Remove Environment.IsWindows8OrAbove property and related Windows 7 compatibility code #122810
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
Conversation
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
Show resolved
Hide resolved
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
jkotas
left a comment
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.
@tannergooding We have a hard dependency on Win8+ after the recent change so IsWindows8OrAbove condition can be deleted
|
Tagging subscribers to this area: @dotnet/area-system-runtime |
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.
Pull request overview
This PR removes the obsolete Environment.IsWindows8OrAbove internal property, which always returned true since Windows 8 is now the minimum supported version. The cleanup eliminates dead code paths that were unreachable on currently supported platforms.
Key changes:
- Removed
IsWindows8OrAboveproperty andWindowsVersionhelper class from Environment.Win32.cs - Removed Windows 7/Server 2008 R2 workarounds in CompareInfo.Nls.cs (3 conditional blocks for LCMapStringEx buffer handling)
- Simplified conditional logic in EventSource.cs by removing an always-true condition
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Environment.Win32.cs | Removed the IsWindows8OrAbove property definition and the WindowsVersion helper class |
| CompareInfo.Nls.cs | Removed 3 Windows 7/Server 2008 R2 specific workarounds for LCMapStringEx buffer handling that were no longer executed |
| EventSource.cs | Removed conditional check and made SetInformation call unconditional (the condition was always true) |
The code changes are clean and correct. All removed code paths were indeed unreachable since IsWindows8OrAbove always returned true. The removal of the Windows 7/Server 2008 R2 workarounds is appropriate, and the EventSource.cs logic simplification correctly reflects that the original condition (this.Name != "System.Diagnostics.Eventing.FrameworkEventSource" || Environment.IsWindows8OrAbove) was always true. No issues found.
|
I take it I can start opening pull requests for #71075? |
Yes, these cleanups can proceed now. |
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
Show resolved
Hide resolved
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
/ba-g wasm timeout without a log |
Removed
Environment.IsWindows8OrAboveinternal property and related Windows 7 compatibility code, which is obsolete since Windows 7 is no longer supported.