diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs index 98ebc8121ae7..c1e9e0e94c55 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs @@ -855,11 +855,11 @@ static void Main(string[] args) .Should() .Pass(); - var result = new DotnetCommand(Log, "run") - .WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name)) - .Execute(); + var exePath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll"); + + var result = new DotnetCommand(Log, "exec", exePath).Execute(); result.Should().Pass(); - result.StdOut.StripTerminalLoggerProgressIndicators().Should().BeEquivalentTo(expectedFrameworkDisplayName); + result.StdOut.Should().BeEquivalentTo(expectedFrameworkDisplayName); } } }