Skip to content

Commit 887c776

Browse files
committed
Only apply architecture when it is the same (microsoft#15250)
1 parent af8bb0c commit 887c776

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,12 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(
569569
}
570570
else
571571
{
572-
// Set the architecture specific variable to the environment of the process so it is picked up.
573-
startInfo.EnvironmentVariables.Add(environmentVariableName, dotnetRootPath);
572+
var architectureFromEnv = (Architecture)Enum.Parse(typeof(Architecture), dotnetRootArchitecture, ignoreCase: true);
573+
if (architectureFromEnv == _architecture)
574+
{
575+
// Set the architecture specific variable to the environment of the process so it is picked up.
576+
startInfo.EnvironmentVariables.Add(environmentVariableName, dotnetRootPath);
577+
}
574578
}
575579
}
576580
else

0 commit comments

Comments
 (0)