Raise error when PackageReference has no version
Bug
Fixes: https://github.com/NuGet/Home/issues/13796
Description
Add validation before resolving the package graph, that PackageReference items have the version specified. Only applies for SdkAnalysisLevel 10.0.100 and above, otherwise the NU1604 "no lower bound" warning is generated as before.
I also changed the SDK Analysis Level helper, because as more features gate on different versions, each feature having its own field/property will become very long, and the existing implementation had multiple duplicate version objects. This PR changes the helper to have a field that represents the version, and references to the feature names are changed to their corresponding versions.
PR Checklist
- [x] Meaningful title, helpful description and a linked NuGet/Home issue
- [x] Added tests
- [ ] Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.
The changes look good to me:
We probably need to follow: https://github.com/NuGet/NuGet.Client/pull/6341.
cc @aortiz-msft
Is this an opt-in or opt-out behaviour?
Removing my assignment from a Draft pull request.
I lost my test in a bad rebase 😭
dotnet/docs issue about the SDK breaking change:
- https://github.com/dotnet/docs/issues/46386