You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
ColorLogger -> C:\Users\bouchraREKHADDA\source\repos\ColorLogger\bin\Debug\net48\ColorLogger.dll
Full log available in C:\Users\bouchraREKHADDA\AppData\Local\Temp\ColorLogger\msbuild_20220404-112128.log
Actual Behavior
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.WriteMessageAligned(String message, Boolean prefixAlreadyWritten, Int32 prefixAdjustment)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.PrintTargetNamePerMessage(BuildMessageEventArgs e, Boolean lightenText)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.PrintMessage(BuildMessageEventArgs e, Boolean lightenText)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.MessageHandler(Object sender, BuildMessageEventArgs e)
at Microsoft.Build.Logging.ConsoleLogger.MessageHandler(Object sender, BuildMessageEventArgs e)
at ColorLogger.ColorLogger.MessageHandler(Object sender, BuildMessageEventArgs e) in C:\Users\bouchraREKHADDA\source\repos\ColorLogger\ColorLogger.cs:line 140
at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.MessageRaisedHandler(Object sender, BuildMessageEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseMessageEvent(Object sender, BuildMessageEventArgs buildEvent)
--- End of inner exception stack trace ---
at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String
messageResourceName, Boolean initializationException, String[] messageArgs)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseMessageEvent(Object sender, BuildMessageEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent, Int32 sinkId)
at
Microsoft.Build.BackEnd.Logging.EventRedirectorToSink.Microsoft.Build.Framework.IEventRedirector.ForwardEvent(BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.CentralForwardingLogger.EventSource_AnyEventRaised(Object sender, BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
Hello @bouchraRekhadda!
This seems to be a quite recent regression. MSBuild from VS 17.0 on my machine works well, but MSBuild from VS 2022 17.1 indeed fails. I, unfortunately, could not give any good workaround for this bug other than using the working version for the time being, if it agreeable for you.
I will take a look this week if there is a quick fix for this issue.
Changing the way we specify the maximum CPU count ColorLogger.cs#L81 with logger.Initialize(null, nodeCount) fixes the issue. (I am not sure though why we were specifying it that way -it's a legacy code-)
I'll close this issue. Feel free to reopen if you think there is a room for enhancement.
Hello @AR-May,
Sorry I've closed the issue without refreshing the page, so I've missed your comment.
As I explained above, we have managed to workaround this issue. If you think there is maybe something to fix in MSBuild, you can reopen it.
MSBuild 17.1.0 unable to use costume logger when maximum CPU is used (
/m
)Starting from version
17.1.0
(more precisely17.1.0.7609
) MSBuild no longer capable of using a custom logger, that used to work with version16.11.2
Steps to Reproduce
Sample reproduction repository can be found at bouchraRekhadda/ColorLogger.
net48
Expected Behavior
Actual Behavior
Ask us questions
Originally asked in #4098 (comment)
The text was updated successfully, but these errors were encountered: