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

[WebToolsE2E][Aspire] There are some garbled characters in the Aspire dashboard Console log after installing SDK 9.0 RC2 #5716

Open
Rita003 opened this issue Sep 14, 2024 · 11 comments
Assignees
Labels
bug Something isn't working external Issues that represent work that's external to this repo.
Milestone

Comments

@Rita003
Copy link

Rita003 commented Sep 14, 2024

REGRESSION INFO:
Work in SDK 8.0.401 + Aspire 8.2.0
Work in SDK 9.0 RC1 + Aspire 9.0 P4

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU

  2. Install SDK 9.0.100-rc.2.24463.45

    • Apply feed for SDK 9.0 RC2
  3. Install Aspire 9.0.0-preview.4.24463.11

    • Apply the dotnet8 feed for Aspire 9.0P4

REPRO STEPS

  1. Open CMD, create an Aspire Starter App using following commands:
dotnet new aspire-starter -o AspireStarterApp
cd AspireStarterApp/AspireStarterApp.AppHost
  1. Dotnet run the project in CMD, and open URL in the browser.
    dotnet run
  2. Click the "Console" option on the Aspire dashboard left, and select the apiservice/webfrontend resource.

Note:

  1. This issue also repro on SDK 8.0.401 + SDK 9.0 RC2 + Aspire 8.2.0.
  2. This issue doesn't repro when running the Aspire Starter App in VS/VSCode

ACTUAL
There are some garbled characters in the console log
Screenshot 2024-09-14 172119

EXPECTED
There is no garbled code in the console log
Screenshot 2024-09-14 164442

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 14, 2024
@davidfowl davidfowl added bug Something isn't working and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 14, 2024
@davidfowl
Copy link
Member

Does this happen on every project and only at the beginning?

@davidfowl davidfowl added this to the 9.0 milestone Sep 15, 2024
@Rita003
Copy link
Author

Rita003 commented Sep 18, 2024

Does this happen on every project and only at the beginning?

@davidfowl This issue happens on every project every time

@davidfowl
Copy link
Member

@JamesNK can you look at this?

@JamesNK
Copy link
Member

JamesNK commented Sep 18, 2024

I searched for some of the garbled characters and they match up with some ANSI escape sequences

https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797#common-private-modes

ESC[?25h = show cursor
ESC[?25l = hide cursor

Hmm, is .NET 9 doing some funky stuff when the console starts up now? Introduced in RC2?

@davidfowl
Copy link
Member

cc @stephentoub ?

@stephentoub
Copy link
Member

Hmm, is .NET 9 doing some funky stuff when the console starts up now? Introduced in RC2?

Not to my knowledge. And I don't see any meaningful changes in System.Console in the last several months.

Plus if this is actually Windows as cited, System.Console on Windows doesn't emit ANSI escape sequences; it uses the Win32 APIs for interactions. It only uses ANSI escape sequences on Unix.

@JamesNK
Copy link
Member

JamesNK commented Sep 18, 2024

DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION is set to true.

Maybe the new output is added in the Microsoft.Extensions.Logging layer?

Regardless of where the output is added from, the Aspire console UI shouldn't print them. If there is an unknown/unsupport sequence then it should be ignored. And to avoid blank lines, perhaps ignore adding the line of output if it is 100% unsupported control characters.

@JamesNK JamesNK self-assigned this Sep 18, 2024
@JamesNK
Copy link
Member

JamesNK commented Sep 18, 2024

Some of the strings didn't look like the ANSI codes as I know them. I searched more to see if I could find them and got:

https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC

ESC]9;4;3;0\ in the garbage text is for setting progress state in the taskbar.

@JamesNK
Copy link
Member

JamesNK commented Sep 18, 2024

I think the console output is coming from here:

https://github.com/dotnet/msbuild/blob/5bab860b2477f03050f170473a2563c5217d546f/src/Framework/Logging/AnsiCodes.cs#L95-L123

How could msbuild logging leak into the app's console output?

@rainersigwald
Copy link
Member

Are y'all invoking the dotnet run command and piping its output into this? That might repro this (dotnet/msbuild#10579, fix just approved for RC2).

@davidfowl
Copy link
Member

Yes!

@davidfowl davidfowl added external Issues that represent work that's external to this repo. and removed area-dashboard labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Issues that represent work that's external to this repo.
Projects
None yet
Development

No branches or pull requests

5 participants