msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Assertion in TL build

Open rainersigwald opened this issue 2 months ago • 1 comments

Got this when building the MSBuild repo with a private build (that shouldn't have had interesting changes):

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
EvalProjectInfo should have been captured before ProjectStarted

   at Microsoft.Build.Logging.TerminalLogger.ProjectStarted(Object sender, ProjectStartedEventArgs e) in S:\msbuild\src\Build\Logging\TerminalLogger\TerminalLogger.cs:line 658
   at Microsoft.Build.Logging.ReusableLogger.ProjectStartedHandler(Object sender, ProjectStartedEventArgs e) in S:\msbuild\src\Build\Logging\ReusableLogger.cs:line 538
   at Microsoft.Build.Framework.ProjectStartedEventHandler.Invoke(Object sender, ProjectStartedEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\EventSourceSink.cs:line 261
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent, Int32 sinkId) in S:\msbuild\src\Build\BackEnd\Components\Logging\EventSourceSink.cs:line 224
   at Microsoft.Build.BackEnd.Logging.EventRedirectorToSink.Microsoft.Build.Framework.IEventRedirector.ForwardEvent(BuildEventArgs buildEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\EventRedirectorToSink.cs:line 57
   at Microsoft.Build.BackEnd.Logging.CentralForwardingLogger.EventSource_AnyEventRaised(Object sender, BuildEventArgs buildEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\CentralForwardingLogger.cs:line 121
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(BuildEventArgs buildEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\EventSourceSink.cs:line 410
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\EventSourceSink.cs:line 347
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(BuildEventArgs eventArg) in S:\msbuild\src\Build\BackEnd\Components\Logging\LoggingService.cs:line 1724
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\LoggingService.cs:line 1679
   at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent) in S:\msbuild\src\Build\BackEnd\Components\Logging\LoggingService.cs:line 1512
   at Microsoft.Build.BackEnd.Logging.LoggingService.<StartLoggingEventProcessing>g__LoggingEventProc|155_0() in S:\msbuild\src\Build\BackEnd\Components\Logging\LoggingService.cs:line 1392
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

---------------------------
Abort   Retry   Ignore   
---------------------------

This assertion was introduced in https://github.com/dotnet/msbuild/pull/12292/files#diff-d0f19d11f07ec2bcb4d3a2f713bbd4460e8a81b110bef1c79cb35d95fbb24346R649.

The build event being handled is

  Name Value Type
e {Microsoft.Build.Framework.ProjectStartedEventArgs} Microsoft.Build.Framework.ProjectStartedEventArgs
  ◢ BuildEventContext {Node=2 Submission=2 ProjectContext=443 ProjectInstance=146 Eval=-1 Target=-1 Task=-1} Microsoft.Build.Framework.BuildEventContext
  BuildRequestId -2035575779 long
  EvaluationId -1 int
  NodeId 2 int
  ProjectContextId 443 int
  ProjectInstanceId 146 int
  SubmissionId 2 int
  TargetId -1 int
  TaskId -1 int
  _evaluationId -1 int
  _nodeId 2 int
  _projectContextId 443 int
  _projectInstanceId 146 int
  _submissionId 2 int
  _targetId -1 int
  _taskId -1 int
  ▶ Static members    
  FormattedMessage null string
  ▶ GlobalProperties Count = 26 System.Collections.Generic.IDictionary<string, string> {System.Collections.Generic.Dictionary<string, string>}
  HelpKeyword null string
  Items {System.Collections.DictionaryEntry[0]} System.Collections.IEnumerable {System.Collections.DictionaryEntry[]}
  Message "Project "MSBuild.csproj" (GetTargetFrameworks target(s)):" string
  ▶ ParentProjectBuildEventContext {Node=24 Submission=2 ProjectContext=58 ProjectInstance=161 Eval=-1 Target=40 Task=19} Microsoft.Build.Framework.BuildEventContext
  ProjectFile "S:\msbuild\src\MSBuild\MSBuild.csproj" string
  ProjectId 146 int
  Properties {System.Collections.DictionaryEntry[0]} System.Collections.IEnumerable {System.Collections.DictionaryEntry[]}
  RawArguments null object[]
  RawMessage "Project "MSBuild.csproj" (GetTargetFrameworks target(s)):" string
  ▶ RawTimestamp {10/16/2025 2:05:53 PM} System.DateTime
  SenderName "MSBuild" string
  TargetNames "GetTargetFrameworks" string
  ThreadId 26 int
  ▶ Timestamp {10/16/2025 9:05:53 AM} System.DateTime
  ToolsVersion "Current" string
  WarningsAsErrors null System.Collections.Generic.ISet
  WarningsAsMessages null System.Collections.Generic.ISet
  WarningsNotAsErrors null System.Collections.Generic.ISet
  ▶ _localTimestamp {10/16/2025 9:05:53 AM} System.DateTime?
  argumentsOrFormattedMessage null object
  ▶ buildEventContext {Node=2 Submission=2 ProjectContext=443 ProjectInstance=146 Eval=-1 Target=-1 Task=-1} Microsoft.Build.Framework.BuildEventContext
  ▶ globalProperties Count = 26 System.Collections.Generic.IDictionary<string, string> {System.Collections.Generic.Dictionary<string, string>}
  helpKeyword null string
  items null System.Collections.IEnumerable
  message "Project "MSBuild.csproj" (GetTargetFrameworks target(s)):" string
  ▶ parentProjectBuildEventContext {Node=24 Submission=2 ProjectContext=58 ProjectInstance=161 Eval=-1 Target=40 Task=19} Microsoft.Build.Framework.BuildEventContext
  projectFile "S:\msbuild\src\MSBuild\MSBuild.csproj" string
  projectId 146 int
  properties null System.Collections.IEnumerable
  senderName "MSBuild" string
  targetNames "GetTargetFrameworks" string
  threadId 26 int
  ▶ timestamp {10/16/2025 2:05:53 PM} System.DateTime
  toolsVersion "Current" string

So I guess it's the EvaluationId = -1 that's tripping things up.

rainersigwald avatar Oct 16 '25 14:10 rainersigwald

+1 hit it when building dotnet new aspire-sample with our main debug build

JanProvaznik avatar Nov 21 '25 10:11 JanProvaznik