From 88223a5d2d537b427e2d3036b7dd5e2a7d7bfeff Mon Sep 17 00:00:00 2001 From: Peter Marcu Date: Thu, 26 Apr 2018 16:18:33 -0700 Subject: [PATCH 1/2] Updating arch support for arm --- .../RuntimeEnvironment.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs b/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs index 5cd62889f4..4c074f957f 100644 --- a/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs +++ b/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Runtime.InteropServices; using Microsoft.DotNet.PlatformAbstractions.Native; namespace Microsoft.DotNet.PlatformAbstractions @@ -23,7 +24,7 @@ private static string GetArch() #if NET45 return Environment.Is64BitProcess ? "x64" : "x86"; #else - return IntPtr.Size == 8 ? "x64" : "x86"; + return RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant(); #endif } @@ -36,11 +37,7 @@ public static string GetRuntimeIdentifier() private static string GetRIDArch() { - if (!string.IsNullOrEmpty(RuntimeArchitecture)) - { - return $"-{RuntimeArchitecture.ToLowerInvariant()}"; - } - return string.Empty; + return $"-{RuntimeArchitecture}"; } private static string GetRIDVersion() From 760c805ca189100a4a85e891baebe379cfa21671 Mon Sep 17 00:00:00 2001 From: Peter Marcu Date: Thu, 26 Apr 2018 16:33:58 -0700 Subject: [PATCH 2/2] Switching to process instead of OS arch --- .../Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs b/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs index 4c074f957f..ffece180eb 100644 --- a/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs +++ b/src/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs @@ -24,7 +24,7 @@ private static string GetArch() #if NET45 return Environment.Is64BitProcess ? "x64" : "x86"; #else - return RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant(); + return RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); #endif }