Skip to content

Commit

Permalink
Redirect default install location in test to avoid using machine-wide…
Browse files Browse the repository at this point in the history
… install (#45525)
  • Loading branch information
github-actions[bot] authored Dec 10, 2020
1 parent e5587e5 commit 8979ee3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ private CommandResult RunTest(Func<RuntimeConfig, RuntimeConfig> runtimeConfig)
SharedState.FrameworkReferenceApp,
new TestSettings()
.WithRuntimeConfigCustomizer(runtimeConfig)
.WithEnvironment(Constants.TestOnlyEnvironmentVariables.GloballyRegisteredPath, SharedState.DotNetGlobalHive.BinPath),
.WithEnvironment(Constants.TestOnlyEnvironmentVariables.GloballyRegisteredPath, SharedState.DotNetGlobalHive.BinPath)
.WithEnvironment( // Redirect the default install location to an invalid location so that a machine-wide install is not used
Constants.TestOnlyEnvironmentVariables.DefaultInstallPath,
System.IO.Path.Combine(SharedState.DotNetMainHive.BinPath, "invalid")),
// Must enable multi-level lookup otherwise multiple hives are not enabled
multiLevelLookup: true);
}
Expand Down

0 comments on commit 8979ee3

Please sign in to comment.