Consider switching from RuntimeInformation.IsOSPlatform(XYZ) to OperatingSystem.IsXYZ() #24653
Labels
affected-all
This issue impacts all the customers
area-blazor
Includes: Blazor, Razor Components
area-infrastructure
Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
help wanted
Up for grabs. We would accept a PR to help resolve this issue
severity-nice-to-have
This label is used by an internal tool
task
Milestone
In dotnet/runtime#40457 new methods that allow for instant OS checks were introduced:
All the
IsXYZ
methods (notIsXYZVersionAtLeast()
) are basically returning constants and thanks to that, JIT is capable of performing dead code elimination:For
net5.0
libs/apps you might consider switching from the old API (RuntimeInformation.IsOSPlatform(XYZ)
) to the new one./cc @davidfowl
The text was updated successfully, but these errors were encountered: