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); }