Skip to content

RunCommand prints "Building..." by default if it needs to build #35263

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

Closed

Conversation

epidemicz
Copy link

When dotnet run needs to build the project it will now print the Building... message by default unless dotnetRunMessages is set to false.

  • added test project that has dotnetRunMessages set to false
  • added a test to ensure it is printed when dotnetRunMessage is true
  • added a test to ensure it isn't printed when dotnetRunMessage is false
  • changed test to ensure it is printed by default/no launch settings

I found it confusing that certain project templates would print the Building... message and others wouldn't.

It seems more consistent to have dotnet run print Building... by default. This also mirrors the behavior of dotnet watch

- Building message will print unless dotnetRunMessages is false

- added test project that has dotnetRunMessages set to false
- added a test to ensure it is printed when dotnetRunMessage is true
- added a test to ensure it isn't printed when dotnetRunMessage is false
- changed test to ensure it is printed by default/no launch settings
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Sep 9, 2023
@epidemicz
Copy link
Author

@dotnet-policy-service agree

@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Sep 10, 2023

Whether documentation would have to be updated if this PR were merged:

The dotnetRunMessages setting was originally added in #12581 to fix #12227.

@KalleOlaviNiemitalo
Copy link
Contributor

Outputting the "Building..." message by default could be a breaking change for users who use dotnet run on a console application, redirect the standard output, and expect it to contain only the output of the application itself. If a user hits that problem, I think they're likely to look in https://learn.microsoft.com/dotnet/core/tools/dotnet-run for a solution, so it could be useful to mention dotnetRunMessages there. On the other hand, perhaps those users should instead run dotnet build separately and then dotnet run --no-build; this avoids the "Building..." message as well as any MSBuild messages.

@baronfel
Copy link
Member

Dotnet run should not show any build messages by default - specifically because users use this command as a shorthand for actually invoking their applications. This differs greatly from watch in intent.

@epidemicz
Copy link
Author

You're right, I don't want to break anybody. Well a little, but it's probably not for the best. Thanks for the feedback, I think I will look into a PR to add some information about dotnetRunMessages, I think it could use it. Thanks again.

@epidemicz epidemicz closed this Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants