diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/RunCommand.cs b/src/mono/wasm/Wasm.Build.Tests/Common/RunCommand.cs index b13b6011de265..5ab27489622ae 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/RunCommand.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/RunCommand.cs @@ -11,7 +11,7 @@ public class RunCommand : DotNetCommand public RunCommand(BuildEnvironment buildEnv, ITestOutputHelper _testOutput, string label="") : base(buildEnv, _testOutput, false, label) { WithEnvironmentVariables(buildEnv.EnvVars); - WithEnvironmentVariable("DOTNET_ROOT", buildEnv.DotNet); + WithEnvironmentVariable("DOTNET_ROOT", Path.GetDirectoryName(buildEnv.DotNet)!); WithEnvironmentVariable("DOTNET_INSTALL_DIR", Path.GetDirectoryName(buildEnv.DotNet)!); WithEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0"); WithEnvironmentVariable("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "1");