From d184af69e311cfefcea099c72375581d9d6f9d7a Mon Sep 17 00:00:00 2001 From: mayankbansal018 Date: Mon, 30 Oct 2017 16:53:16 +0530 Subject: [PATCH] Get OSArchitecture from Platform Abstraction to check for ARM Processor (#1242) * GetOsArchitecture from Platform Abstraction to check for ARM * making sure path is always small --- .../common/System/ProcessHelper.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs index feaaa76502..ec924ed47b 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs @@ -179,8 +179,13 @@ public PlatformArchitecture GetCurrentProcessArchitecture() /// public string GetNativeDllDirectory() { - var isArm = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Contains("ARM"); - return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString(), isArm ? ARM : string.Empty); + var osArchitecture = new PlatformEnvironment().Architecture; + if (osArchitecture == PlatformArchitecture.ARM || osArchitecture == PlatformArchitecture.ARM64) + { + return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower(), ARM); + } + + return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower()); } } }