From 5c1182ce41be6cac87357d288bb656407faa688a Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Tue, 20 Oct 2020 14:11:54 +1300 Subject: [PATCH] Fix to not require libc-dev on .NET 5 or later --- src/csharp/Grpc.Core/Internal/PlatformApis.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/PlatformApis.cs b/src/csharp/Grpc.Core/Internal/PlatformApis.cs index 8d7e8c2acb5..db2b7d64038 100644 --- a/src/csharp/Grpc.Core/Internal/PlatformApis.cs +++ b/src/csharp/Grpc.Core/Internal/PlatformApis.cs @@ -49,11 +49,15 @@ namespace Grpc.Core.Internal static PlatformApis() { -#if NETSTANDARD1_5 || NETSTANDARD2_0 +#if NETSTANDARD isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - isNetCore = RuntimeInformation.FrameworkDescription.StartsWith(".NET Core"); + isNetCore = +#if NETSTANDARD2_0 + Environment.Version.Major >= 5 || +#endif + RuntimeInformation.FrameworkDescription.StartsWith(".NET Core"); #else var platform = Environment.OSVersion.Platform;