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
Update "items" seem to be executed sequentially, so the second "Foo" line will take effect and the first will be totally ignored.
Now, this is a mistake in any Packages.props that has this - you can only have 1 global version. But it's a silent mistake and an easy one to make. So it would be nice to have some logic to catch this and break the build when there are duplicates.
While I think that rationale is easy to justify, the problem is that can't think of a good way to implement this in the MSBuild language. You can't do filtering or transforms on the update lines because they are not the actual PackageReference items, they're essentially just statements that change the metadata.
I can always make an XML parsing script to check for duplicates for my own team. Or we could be more disciplined about keeping update lines alphabetized (though I don't know how to enforce that with MSBuild either). But if there's a way to do this, it would be a big help.
The text was updated successfully, but these errors were encountered:
This seems like a great feature, I agree that it can be a tough mistake to catch. Off the top of my head, the only way to detect this would be to look at the XML which might be slow. I can ask the MSBuild team to see if there's a better way.
I actually got bitten by this by importing a different .props into Packages.props. So if this feature can even notice those cases, that would be even better.
With Central Package Versions, you can have a Packages.props that does this:
Update "items" seem to be executed sequentially, so the second "Foo" line will take effect and the first will be totally ignored.
Now, this is a mistake in any Packages.props that has this - you can only have 1 global version. But it's a silent mistake and an easy one to make. So it would be nice to have some logic to catch this and break the build when there are duplicates.
While I think that rationale is easy to justify, the problem is that can't think of a good way to implement this in the MSBuild language. You can't do filtering or transforms on the update lines because they are not the actual PackageReference items, they're essentially just statements that change the metadata.
I can always make an XML parsing script to check for duplicates for my own team. Or we could be more disciplined about keeping update lines alphabetized (though I don't know how to enforce that with MSBuild either). But if there's a way to do this, it would be a big help.
The text was updated successfully, but these errors were encountered: