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

[release/9.0.1xx] Using ConsoleLogger to prevent unexpected behavior #45015

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

MichalPavlik
Copy link
Member

@MichalPavlik MichalPavlik commented Nov 21, 2024

Fixes dotnet/msbuild#10998

Summary

dotnet run directly creates an instance of TerminalLogger, bypassing all checks. This can lead to situations where ANSI escape sequences are emitted to the terminal, even if the terminal does not support them. These escape sequences are also emitted when the standard output is redirected, which can break a CI build that relies on the command's output.

Changes Made

Minimal hotfix: The ConsoleLogger is used instead of TerminalLogger for this SDK version.

Customer Impact

Some customers reported unexpected behavior of dotnet run command and CI builds failures.

Regression?

Yes.

Testing

Manual testing with locally updated SDK.

Notes

There is a proper fix created for 9.0.2xx. This change shouldn't flow to higher versions.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Nov 21, 2024
@MichalPavlik MichalPavlik changed the title [9.0.1xx] Using ConsoleLogger to prevent unexpected behavior [release/9.0.1xx] Using ConsoleLogger to prevent unexpected behavior Nov 21, 2024
@baronfel baronfel merged commit e2b4f9e into release/9.0.1xx Nov 21, 2024
31 checks passed
@baronfel baronfel deleted the dev/mipavlik/fix-dotnet-run-901xx branch November 21, 2024 18:50
@baronfel
Copy link
Member

Also needs to be backported to the internal 101 release branch.

marcpopMSFT pushed a commit that referenced this pull request Nov 22, 2024
…xpected behavior (#45015)

Cherry-pick #45015 to the 9.0.101 hotfix branch to ensure the change makes it to the hotfix.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request addresses unexpected behavior by replacing the `TerminalLogger` with `ConsoleLogger` as a temporary fix for version 9.0.1xx.
- `src/Cli/dotnet/commands/dotnet-run/RunCommand.cs`: Replaced `TerminalLogger` with `ConsoleLogger` to prevent unexpected behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CLI Servicing-approved untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants