Skip to content

MSBuild logger failing with NullReferenceException during build #37291

@safern

Description

@safern

Some builds are failing with:

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.Execution.ProjectItemInstance.TaskItem.CloneCustomMetadata() 
at Microsoft.Build.Logging.BuildEventArgsWriter.Write(ITaskItem item) 
at Microsoft.Build.Logging.BuildEventArgsWriter.WriteItems(IEnumerable items) 
at Microsoft.Build.Logging.BinaryLogger.Write(BuildEventArgs e) 
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs 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.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent) 
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent) 

MSBuild issue: dotnet/msbuild#5296

It might be related to the recent SDK update.

https://dnceng.visualstudio.com/public/_build/results?buildId=667294&view=logs&j=33cd310f-7621-5644-767a-a2e64a1284cc&t=cf0e932f-635e-53b1-d9df-510ebd2e05d1&l=1740
https://dev.azure.com/dnceng/internal/_build/results?buildId=666725&view=results

cc: @dotnet/runtime-infrastructure @rainersigwald

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions