Skip to content

Commit

Permalink
Merged PR 45245: [release/9.0.1xx] Using ConsoleLogger to prevent une…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
baronfel authored and marcpopMSFT committed Nov 21, 2024
1 parent 803acc2 commit 4b6c318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Cli/dotnet/commands/dotnet-run/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ public void Shutdown()
static ILogger MakeTerminalLogger(VerbosityOptions? verbosity)
{
var msbuildVerbosity = ToLoggerVerbosity(verbosity);
var thing = Assembly.Load("MSBuild").GetType("Microsoft.Build.Logging.TerminalLogger.TerminalLogger")!.GetConstructor([typeof(LoggerVerbosity)])!.Invoke([msbuildVerbosity]) as ILogger;

// Temporary fix for 9.0.1xx. 9.0.2xx will use the TerminalLogger in the safe way.
var thing = new ConsoleLogger(msbuildVerbosity);
return thing!;
}

Expand Down

0 comments on commit 4b6c318

Please sign in to comment.