From 7b4a2c8691705f26bdaf5281f29e2f1dadc2d762 Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Tue, 20 Oct 2020 17:24:33 +1300 Subject: [PATCH] Tweak .NET [Core] detection --- src/Cake.Core/Polyfill/EnvironmentHelper.cs | 4 ++-- src/Cake.Core/Polyfill/Runtime.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Core/Polyfill/EnvironmentHelper.cs b/src/Cake.Core/Polyfill/EnvironmentHelper.cs index d21574b019..821a776ff9 100644 --- a/src/Cake.Core/Polyfill/EnvironmentHelper.cs +++ b/src/Cake.Core/Polyfill/EnvironmentHelper.cs @@ -92,8 +92,8 @@ public static bool IsCoreClr() #if NETCORE if (_isCoreClr == null) { - _isCoreClr = RuntimeInformation.FrameworkDescription.StartsWith(".NET Core") - || RuntimeInformation.FrameworkDescription.StartsWith(".NET 5"); + _isCoreClr = Environment.Version.Major >= 5 + || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core"); } return _isCoreClr.Value; #else diff --git a/src/Cake.Core/Polyfill/Runtime.cs b/src/Cake.Core/Polyfill/Runtime.cs index 6c6ef260dc..34fc132381 100644 --- a/src/Cake.Core/Polyfill/Runtime.cs +++ b/src/Cake.Core/Polyfill/Runtime.cs @@ -11,7 +11,7 @@ public enum Runtime Clr, /// - /// .NET Core / .NET 5. + /// .NET Core or .NET 5+. /// CoreClr }