Add polyfills for some of the OperatingSystem.IsXyz() methods#34
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds polyfills for operating system detection methods from .NET 5.0, making them available to earlier framework versions. The implementation provides backward compatibility for OS platform checks and version detection.
- Adds
OperatingSystem.IsFreeBSD(),IsLinux(),IsMacOS(),IsWindows(), andIsWindowsVersionAtLeast()methods - Introduces
OSPlatform.FreeBSDproperty for .NET Core 3.0 and earlier - Includes a placeholder
OperatingSystemclass for .NET Core 2.0 and earlier frameworks
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| PolyShim/Net50/OperatingSystem.cs | Implements polyfills for OperatingSystem.IsXyz() methods and IsWindowsVersionAtLeast() for pre-.NET 5.0 frameworks |
| PolyShim/NetCore30/OSPlatform.cs | Adds OSPlatform.FreeBSD property polyfill for .NET Core 3.0 and earlier |
| PolyShim/NetCore20/OperatingSystem.cs | Provides placeholder OperatingSystem class for .NET Core 2.0 and earlier to support extension methods |
| PolyShim/NetCore20/SystemException.cs | Adds blank line for code formatting consistency |
| PolyShim.Tests/Net50/OperatingSystemTests.cs | Adds tests for IsLinux(), IsMacOS(), and IsWindows() methods across different platforms |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #34 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.