Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet run writes the "Using launch settings from ..." message to stdout instead of stderr #45640

Open
Aethon opened this issue Dec 27, 2024 · 2 comments
Labels
untriaged Request triage from a team member

Comments

@Aethon
Copy link

Aethon commented Dec 27, 2024

Describe the bug

[On a Mac M1 using .NET 9.]
When using dotnet run to run a project that uses a launchSettings.json file, it writes a startup message like "Using launch settings from {filename}..." to stdout. Other run messages are written (correctly) to stderr. Because the message is written to stdout, it mixes in with the expect output of the program, often making it unparseable.

To Reproduce

  1. Clone this simple console project example: https://github.com/Aethon/DotNetOutputExample.
  2. Execute dotnet run > output.json.
  3. Examine output.json and note that it is not valid JSON due to the message at the top.

Further technical details

The errant line of code is here: https://github.com/dotnet/sdk/blob/main/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs#L135.

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Dec 27, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant