From 21e916603a9f4c1a3d949c3790731e1cc0f843b2 Mon Sep 17 00:00:00 2001 From: Peter Marcu Date: Mon, 30 Apr 2018 16:41:34 -0700 Subject: [PATCH] Updating arch support for arm (#4085) (#4103) * Updating arch support for arm * Switching to process instead of OS arch --- .../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..ffece180eb 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.ProcessArchitecture.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()