Fix false error for transitively pinned dependency with no version - #7004
#7004Merged
jeffkl merged 2 commits intoDec 12, 2025
devNuGet/NuGet.Client:devfrom
dev-jeffkl-fix-pinned-transitive-dep-missing-versionNuGet/NuGet.Client:dev-jeffkl-fix-pinned-transitive-dep-missing-versionCopy head branch name to clipboard
Merged
Fix false error for transitively pinned dependency with no version#7004jeffkl merged 2 commits intodevNuGet/NuGet.Client:devfrom dev-jeffkl-fix-pinned-transitive-dep-missing-versionNuGet/NuGet.Client:dev-jeffkl-fix-pinned-transitive-dep-missing-versionCopy head branch name to clipboard
jeffkl merged 2 commits into
devNuGet/NuGet.Client:devfrom
dev-jeffkl-fix-pinned-transitive-dep-missing-versionNuGet/NuGet.Client:dev-jeffkl-fix-pinned-transitive-dep-missing-versionCopy head branch name to clipboard
Conversation
nkolev92
approved these changes
Dec 12, 2025
Nigusu-Allehu
approved these changes
Dec 12, 2025
zivkan
approved these changes
Dec 12, 2025
donnie-msft
approved these changes
Dec 12, 2025
jeffkl
enabled auto-merge (squash)
December 12, 2025 20:42
jeffkl
deleted the
dev-jeffkl-fix-pinned-transitive-dep-missing-version
branch
December 12, 2025 21:35
This was referenced Dec 14, 2025
|
@jeffkl do you know, when this bug was introduced? Which msbuild versions had it? We have similar issue with msbuild B is centrally defined 0.1.2 |
Contributor
Author
|
@inikulshin this was probably introduced back in 17.12. Its a bit of an anti-pattern to have a package that declares a dependency with no version since NuGet logs a warning during pack. If you control the package that's causing the problem, I would recommend updating it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#14653
Description
The new dependency resolver was falsely detecting a downgrade when a package version was missing from a nuspec because it would see that version
0.0.0is less than what was resolved. However, the version really is justVersionRange.All.The fix is to never consider it a downgrade if the dependency version is
VersionRange.All.I also had to modify the test a little so I could create an environment where a package has a dependency with no version.
PR Checklist