Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clear out DOTNET_ROOT_<arch> in test expecting failure to find .NET
  • Loading branch information
elinor-fung committed Aug 26, 2025
commit f6e9db8f5e97aec8259a616c3e0b1260b4136886
Original file line number Diff line number Diff line change
Expand Up @@ -1161,13 +1161,14 @@ public static void Main()
CopyDirectory(Path.Combine(TestContext.Current.ToolsetUnderTest.DotNetRoot, "shared", "Microsoft.NETCore.App"), Path.Combine(expectedRoot, "shared", "Microsoft.NETCore.App"));
break;
case "EnvironmentVariable":
// Set DOTNET_ROOT environment variable to the expected .NET root
// Set DOTNET_ROOT_<arch> environment variable to the expected .NET root
expectedRoot = TestContext.Current.ToolsetUnderTest.DotNetRoot;
runCommand = runCommand.WithEnvironmentVariable("DOTNET_ROOT", expectedRoot);
runCommand = runCommand.WithEnvironmentVariable($"DOTNET_ROOT_{RuntimeInformation.OSArchitecture.ToString().ToUpperInvariant()}", expectedRoot);
break;
default:
// Should fail - make sure DOTNET_ROOT is not set
runCommand = runCommand.WithEnvironmentVariable("DOTNET_ROOT", string.Empty);
// Should fail - make sure DOTNET_ROOT_<arch> and DOTNET_ROOT are not set
runCommand = runCommand.WithEnvironmentVariable($"DOTNET_ROOT", string.Empty);
runCommand = runCommand.WithEnvironmentVariable($"DOTNET_ROOT_{RuntimeInformation.OSArchitecture.ToString().ToUpperInvariant()}", string.Empty);
break;
}

Expand Down
Loading