Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix false error for transitively pinned dependency with no version - #7004

#7004
Merged
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
Dec 12, 2025
Merged

Fix false error for transitively pinned dependency with no version#7004
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

@jeffkl

@jeffkl jeffkl commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

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.0 is less than what was resolved. However, the version really is just VersionRange.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

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@jeffkl
jeffkl requested a review from nkolev92 December 12, 2025 00:44
@jeffkl jeffkl self-assigned this Dec 12, 2025
@jeffkl
jeffkl requested a review from a team as a code owner December 12, 2025 00:44
@jeffkl
jeffkl requested a review from zivkan December 12, 2025 00:44
@jeffkl
jeffkl enabled auto-merge (squash) December 12, 2025 20:42
@jeffkl
jeffkl merged commit cc8f616 into dev Dec 12, 2025
17 of 18 checks passed
@jeffkl
jeffkl deleted the dev-jeffkl-fix-pinned-transitive-dep-missing-version branch December 12, 2025 21:35
@inikulshin

inikulshin commented Dec 25, 2025

Copy link
Copy Markdown

@jeffkl do you know, when this bug was introduced? Which msbuild versions had it?

We have similar issue with msbuild 17.14.10:

B is centrally defined 0.1.2

A.csproj : warning NU1603: A depends on B (>= 0.1.2) but B 0.1.2 was not found. An approximate best match of B 11.1.0 was resolved.
...
A.csproj : error NU1109: Detected package downgrade: B from 11.1.0 to centrally defined 11.1.0. Update the centrally managed package version to a higher version.

@jeffkl

jeffkl commented Dec 25, 2025

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS2026 install breaks central transitive pinning of unversioned dependencies with NU1109, even in VS2022

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.