diff --git a/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs b/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs index da77434c8d..6d89b4861a 100644 --- a/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs +++ b/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.Extensions.CommandLineUtils; @@ -88,15 +89,19 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests }; args.AddRange(arguments); + var dotnetPath = typeof(WatchableApp).Assembly.GetCustomAttributes() + .Single(s => s.Key == "DotnetPath").Value; + var spec = new ProcessSpec { - Executable = DotNetMuxer.MuxerPathOrDefault(), + Executable = dotnetPath, Arguments = args, WorkingDirectory = SourceDirectory, EnvironmentVariables = { ["DOTNET_CLI_CONTEXT_VERBOSE"] = bool.TrueString, ["DOTNET_USE_POLLING_FILE_WATCHER"] = UsePollingWatcher.ToString(), + ["DOTNET_ROOT"] = Directory.GetParent(dotnetPath).FullName, }, }; diff --git a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj index 2bf2ed51d1..219f55d6f4 100644 --- a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj +++ b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj @@ -17,6 +17,13 @@ + + + <_Parameter1>DotnetPath + <_Parameter2>$(DotNetTool) + + +