Skip to content

Commit 408ea05

Browse files
mayankbansal018smadala
authored andcommitted
Get OSArchitecture from Platform Abstraction to check for ARM Processor (microsoft#1242)
* GetOsArchitecture from Platform Abstraction to check for ARM * making sure path is always small
1 parent 2f8755a commit 408ea05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,13 @@ public PlatformArchitecture GetCurrentProcessArchitecture()
179179
/// <inheritdoc/>
180180
public string GetNativeDllDirectory()
181181
{
182-
var isArm = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Contains("ARM");
183-
return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString(), isArm ? ARM : string.Empty);
182+
var osArchitecture = new PlatformEnvironment().Architecture;
183+
if (osArchitecture == PlatformArchitecture.ARM || osArchitecture == PlatformArchitecture.ARM64)
184+
{
185+
return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower(), ARM);
186+
}
187+
188+
return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower());
184189
}
185190
}
186191
}

0 commit comments

Comments
 (0)