diff --git a/src/Cli/dotnet/Commands/Run/RunCommand.cs b/src/Cli/dotnet/Commands/Run/RunCommand.cs index ee2557bd7e9c..9c72a984d102 100644 --- a/src/Cli/dotnet/Commands/Run/RunCommand.cs +++ b/src/Cli/dotnet/Commands/Run/RunCommand.cs @@ -469,7 +469,7 @@ internal LaunchProfileParseResult ReadLaunchProfileSettings() if (!RunCommandVerbosity.IsQuiet()) { - Reporter.Output.WriteLine(string.Format(CliCommandStrings.UsingLaunchSettingsFromMessage, launchSettingsPath)); + Reporter.Error.WriteLine(string.Format(CliCommandStrings.UsingLaunchSettingsFromMessage, launchSettingsPath)); } return LaunchSettings.ReadProfileSettingsFromFile(launchSettingsPath, LaunchProfile); diff --git a/src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs index d39b57871027..6135b177850c 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs @@ -403,7 +403,7 @@ static RunProperties GetRunProperties(ProjectInstance project) // If buildOptions.Verbosity is null, we still want to print the message. if (buildOptions.Verbosity != VerbosityOptions.quiet) { - Reporter.Output.WriteLine(string.Format(CliCommandStrings.UsingLaunchSettingsFromMessage, launchSettingsPath)); + Reporter.Error.WriteLine(string.Format(CliCommandStrings.UsingLaunchSettingsFromMessage, launchSettingsPath)); } var result = LaunchSettings.ReadProfileSettingsFromFile(launchSettingsPath, profileName); diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs index 330d27eec694..f37bce554551 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs @@ -158,10 +158,12 @@ public void RunTestProjectWithTestsAndLaunchSettings_ShouldReturnExitCodeSuccess if (!SdkTestContext.IsLocalized()) { - result.StdOut + result.StdErr .Should().Contain("Using launch settings from") - .And.Contain(runJson ? "TestProjectWithLaunchSettings.run.json..." : $"Properties{Path.DirectorySeparatorChar}launchSettings.json...") - .And.Contain("Test run summary: Passed!") + .And.Contain(runJson ? "TestProjectWithLaunchSettings.run.json..." : $"Properties{Path.DirectorySeparatorChar}launchSettings.json..."); + + result.StdOut + .Should().Contain("Test run summary: Passed!") .And.Contain("MY_VARIABLE_FROM_LAUNCH_SETTINGS=TestValue1") .And.Contain("skipped Test1") .And.Contain("total: 2") @@ -217,10 +219,12 @@ public void RunTestProjectWithTestsAndLaunchSettingsAndExecutableProfile() .Execute( "-c", TestingConstants.Debug); - result.StdOut.Should() + result.StdErr.Should() .Contain("Using launch settings from") - .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json...") - .And.Contain("FAILED to find argument from launchSettings.json"); + .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json..."); + + result.StdOut.Should() + .Contain("FAILED to find argument from launchSettings.json"); } [InlineData(TestingConstants.Debug)] @@ -237,10 +241,12 @@ public void RunTestProjectWithTestsAndNoLaunchSettingsArguments_ShouldReturnExit "-c", configuration, "--no-launch-profile-arguments", "true"); - result.StdOut.Should() + result.StdErr.Should() .Contain("Using launch settings from") - .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json...") - .And.Contain("FAILED to find argument from launchSettings.json"); + .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json..."); + + result.StdOut.Should() + .Contain("FAILED to find argument from launchSettings.json"); } [InlineData(TestingConstants.Debug)] @@ -575,10 +581,12 @@ public void RunTestProjectWithEnvVariable(string configuration) if (!SdkTestContext.IsLocalized()) { - result.StdOut + result.StdErr .Should().Contain("Using launch settings from") - .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json...") - .And.Contain("Test run summary: Failed!") + .And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json..."); + + result.StdOut + .Should().Contain("Test run summary: Failed!") .And.Contain("total: 1") .And.Contain("succeeded: 0") .And.Contain("failed: 1")