From 8cd7b6713a3219643242411953edc566156ac077 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Wed, 2 Dec 2020 12:28:05 -0800 Subject: [PATCH] Redirect default install location in test to avoid using machine-wide install --- .../FrameworkResolution/MultipleHives.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs b/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs index 4c2ebdac73840..2b09b95c8ec95 100644 --- a/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs +++ b/src/installer/tests/HostActivation.Tests/FrameworkResolution/MultipleHives.cs @@ -78,7 +78,10 @@ private CommandResult RunTest(Func 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); }