Skip to content

Fix outdated package listing crash when no eligible transitive versio… - #7754

Merged
zivkan merged 1 commit into
devfrom
dev-zivkan-package-update-error
Oct 8, 2026
Merged

zivkan merged 1 commit into
devfrom
dev-zivkan-package-update-error

Conversation

@zivkan

@zivkan zivkan commented Oct 6, 2026

Copy link
Copy Markdown
Member

…n exists

Bug

Fixes: NuGet/Home#15098

Description

Fixes dotnet package list --outdated --include-transitive throwing "Sequence contains no matching element" when no eligible version is available for a transitive package.

Package metadata can be returned by a source while every version is excluded by prerelease, listing, or highest-patch/minor constraints. The transitive package path previously attempted to select metadata for a null latest version. It now handles this case consistently with top-level packages, allowing the existing report logic to display "Not found at the sources".

Added a new "unit" test, as the existing similar list package tests are Dotnet.Integration.Tests which takes 2-7 seconds each to run. The new tests takes 12ms on my machine on the first test to jit everything, and then the rest of the tests take less than 1ms each. So, the added tests are comprehensive for all different scenarios, not just the one that the bug is fixing.

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. N/A

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.

dotnet package list --outdated --include-transitive fails when no eligible version is available for a transitive package

4 participants