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 d6ec8d5
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,19 @@ private void AddEnvironmentVariablesTo(ProcessStartInfo psi)
}

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

// Set DOTNET_ROOT to ensure sub process find the same host fxr
string dotnetDirectoryPath = repoDirectoriesProvider.DotnetRoot;
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 d6ec8d5

Please sign in to comment.