Skip to content

Commit

Permalink
Use dotnet exec to run test app in CheckTargetFrameworkDisplayName (#…
Browse files Browse the repository at this point in the history
…45332)

"dotnet run" does some additional steps like restore and build that we don't need and it can cause issues with additional characters in stdout like in #45042 (comment)

Switch to executing the built .dll directly.
  • Loading branch information
akoeplinger authored Dec 17, 2024
1 parent 3093791 commit 981b74b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 981b74b

Please sign in to comment.