Closed rolfbjarne closed 7 months ago
Sorry about that, I thought the viewer doesn't care because these finish quickly enough, but I forgot about the API case.
I just made it that we block on all these tasks before returning the build.
Published https://www.nuget.org/packages/MSBuild.StructuredLogger/2.2.100, hopefully it will work properly for you.
I do something like this:
And sometimes I get different answers between A and B.
It took me a while to figure out what's happening, but the problem is that some items are loaded in the background:
https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/3071c2b297a3e6e38d0112f57d84725b47009a67/src/StructuredLogger/Construction/Construction.cs#L571
https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/3071c2b297a3e6e38d0112f57d84725b47009a67/src/StructuredLogger/Construction/Construction.cs#L993
which means that doing the same thing multiple times might yield different results.
Maybe there should be a setting to say to not load stuff in the background when reading binlogs programmatically?