Some projects are not associated with the MSBuild task that caused them to build
Closed this issue · 6 comments
In 16.6.1 I'm seeing a situation where projects are not parented under the MSBuild task that spawned them.
Repro:
- git clone https://github.com/xunit/xunit
- git checkout 2.4.1
- cd xunit\src\xunit.runner.utility
- msbuild /r /bl
#5013 has implemented that we pass the parent task ID to ProjectStarted.ParentProjectBuildEventArgs, but I'm seeing parent task id == -1.
This only happens for some projects; most projects work fine.
Could it be a race condition where CurrentTaskContext is null?
Apparently others have also run into the same build error here: xunit/xunit#1972
xunit/xunit#1819 is related as well.
OK I think I found the real root cause of the build issue: novotnyllc/MSBuildSdkExtras#127
I have a suspicion that this could happen in the "previously built successfully" situation.
This was much easier than expected. I just missed a case.