Issue Description
The MSB4017 error is not consistently shown when a logger fails.
Steps to Reproduce
- Update the BuildStartedHandler of ParallelConsoleLogger such that it thows an exception. For example, add a throw in that line.
- Run a build of some project. Console app will do. You will see the message along with details: stack trace and exception message.
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
This is an unhandled exception from a logger -- PLEASE OPEN A BUG AGAINST THE LOGGER OWNER.
- Remove the previous code change and update instead the ProjectStartedHandler of ParallelConsoleLogger with some throw (this line).
- Run build again. You will see only
MSBuild version 17.9.0-dev-23574-01+f4b2350ac for .NET Framework
Build started 11/24/2023 3:59:10 PM.
Expected Behavior
I expect to see the error MSB4017 for any logger failure.
Actual Behavior
No error MSB4017 in the second build. The log does not indicate anything about what happened and is confusing.
Analysis
Here is the place where the error was considered benign, and the exception is not thrown up further:
|
if (ExceptionHandling.IsCriticalException(ex)) |
Since customers may write their own logs, including ones that throw exceptions during events handlers, I would suggest address all exceptions that the loggers throw and, in all times, report the logger failure.
Versions & Configurations
No response
Issue Description
The MSB4017 error is not consistently shown when a logger fails.
Steps to Reproduce
Expected Behavior
I expect to see the error MSB4017 for any logger failure.
Actual Behavior
No error MSB4017 in the second build. The log does not indicate anything about what happened and is confusing.
Analysis
Here is the place where the error was considered benign, and the exception is not thrown up further:
msbuild/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs
Line 854 in 7b37a28
Since customers may write their own logs, including ones that throw exceptions during events handlers, I would suggest address all exceptions that the loggers throw and, in all times, report the logger failure.
Versions & Configurations
No response