-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix restore when a package is installed with a version specified in CPM #5982
Conversation
@vernou thanks for the PR. I was hoping it'd be as easy as what this PR currently is. If you look at the CI build, you'll see there's 2 failing test across multiple platforms: AddPkg_WithCPM_WithPackageReference_WithVersionOverride_WithPackageVersion_NoVersionCLI_NoOps and AddPkg_WithCPM_WhenPackageVersionDoesNotExistAndVersionCLIArgNotPassed_Success Have a look at what other tests also exist in the same class, and figure out if we need any more test scenarios. The other tests failing on CI look like they're flakey, so ignore them. |
The test
With the PR fix, the resolved version range from CPM has I see two possibilities :
I don't undertand why the command is expected to fail and the reason/error sounds dirty. @zivkan, what do you think? |
I implemented the second to see. When the version is resolved from CPM, the resolved version I fixed my code and |
After going through the tests to be able to add a test, I think I have a better understanding of how they work. @zivkan, the PR is ready to review. |
Bug
Fixes: NuGet/Home#13657
Description
When
dotnet add package
with version specified inDirectory.Packages.props
, the restored dependency is the last version and no the version specified inDirectory.Packages.props
.The modification :
If a CPM version is available for the installed package then uses it.
Else old behavior (last package version)
PR Checklist