From acc97038e8ce8d299321b12c5691570f38a0a446 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 19 Oct 2018 08:44:39 -0700 Subject: [PATCH] Apply workaround for https://github.com/dotnet/cli/issues/10196 --- test/EndToEnd/GivenDotNetUsesMSBuild.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/EndToEnd/GivenDotNetUsesMSBuild.cs b/test/EndToEnd/GivenDotNetUsesMSBuild.cs index ed0b95c46..474bcf14c 100644 --- a/test/EndToEnd/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd/GivenDotNetUsesMSBuild.cs @@ -37,11 +37,16 @@ namespace Microsoft.DotNet.Tests.EndToEnd .Execute() .Should().Pass(); - new RunCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput() + var runCommand = new RunCommand() + .WithWorkingDirectory(projectDirectory); + + // Set DOTNET_ROOT as workaround for https://github.com/dotnet/cli/issues/10196 + runCommand = runCommand.WithEnvironmentVariable(Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)", + Path.GetDirectoryName(DotnetUnderTest.FullName)); + + runCommand.ExecuteWithCapturedOutput() .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); + .And.HaveStdOutContaining("Hello World!"); var binDirectory = new DirectoryInfo(projectDirectory).Sub("bin"); binDirectory.Should().HaveFilesMatching("*.dll", SearchOption.AllDirectories);