dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.66k stars 1.06k forks source link

SDK 9.0.100-preview.5.24307.3 Logger Output Not Displaying in Console with dotnet watch run #41749

Open charliefr opened 2 months ago

charliefr commented 2 months ago

Title: Logger Output Not Displaying in Console with dotnet watch run

“When running the application with dotnet run, the Logger output displays correctly in the console. The issue only occurs when using dotnet watch run.”

Description: When using dotnet watch run with .NET SDK version 9.0.100-preview.5.24307.3 on Windows 10, the Logger output does not display in the console.

Reproduction Steps:

Install .NET SDK x64 9.0.100-preview.5.24307.3 on Windows 10 using the built-in sandbox. Open the console and rundotnet new blazor or dotnet new webapi. Inject ILogger at any position in the default template files created by dotnet. Use ILogger to output any text. Rundotnet watch run in the console. Access the page where the Logger output is expected. Observed Behavior:

Logger output does not display in the console. Replacing ILogger.LogError("...") with Console.WriteLine("...")also does not display any output in the console. Replacing ILogger.LogError("...")with throw new Exception("...")does not display any output in the console. The browser’s dev tools show the following error:

Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'.
log @ blazor.web.js:1

This is a screenshot of an example file in the default template of blazor image

sveinl commented 2 weeks ago

Any news about this? I still have this issue in preview.7