Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Set DOTNET_ROOT in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
William Li committed Nov 8, 2019
1 parent 3df3c6d commit 442c7b3
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -236,6 +236,17 @@ private void AddEnvironmentVariablesTo(ProcessStartInfo psi)

// Flow the TEST_PACKAGES environment variable to the child process
psi.Environment["TEST_PACKAGES"] = new RepoDirectoriesProvider().TestPackages;

// Set DOTNET_ROOT to ensure sub process find the same host fxr
string dotnetDirectoryPath = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);
if (System.Environment.Is64BitProcess)
{
psi.Environment.Add("DOTNET_ROOT", dotnetDirectoryPath);
}
else
{
psi.Environment.Add("DOTNET_ROOT(x86)", dotnetDirectoryPath);
}
}

private void AddDotnetToolPathToAvoidSettingPermanentEnvInBuildMachineOnWindows()
Expand Down

0 comments on commit 442c7b3

Please sign in to comment.