Skip to content

dotnet list package works with unlisted and prerelease packages#7038

Merged
zivkan merged 3 commits intodevfrom
dev-zivkan-dotnet-list-package-unlisted
Jan 14, 2026
Merged

dotnet list package works with unlisted and prerelease packages#7038
zivkan merged 3 commits intodevfrom
dev-zivkan-dotnet-list-package-unlisted

Conversation

@zivkan
Copy link
Copy Markdown
Member

@zivkan zivkan commented Jan 9, 2026

Bug

Fixes: NuGet/Home#14477

Description

I assume that dotnet list package supported checking for deprecated and vulnerable packages sometime after it supported checking for outdated packages, because some of the method names were different to what they were actually doing, plus the code to get package metadata from package sources wouldn't get metadata about unlisted or prerelease packages, even if the project was using those packages. So, it was changed to always get metadata about prerelease and unlisted packages, and the outdated report was updated to filter out the unlisted packages.

There was some test infrastructure fixes as well. Since commands like dotnet add package run msbuild as a child process before running NuGet's main logic for the command, these child processes were failing because the child process was using the system installed dotnet, rather than the test dotnet, and global.json was forcing it to use a specific version of the sdk. Adding the test dotnet to the path fixed it, allowing --format json to capture and parse json, making validation less fragile from variable space issues.

Also needed to add support for vulnerability info on registration pages to the mock server.

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.

@zivkan zivkan requested a review from a team as a code owner January 9, 2026 20:56
@zivkan zivkan requested review from jeffkl and martinrrm January 9, 2026 20:56
martinrrm
martinrrm previously approved these changes Jan 9, 2026
Copy link
Copy Markdown
Contributor

@martinrrm martinrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding the infrastructure to the tests

@zivkan zivkan force-pushed the dev-zivkan-dotnet-list-package-unlisted branch from 0117e57 to 057bd9b Compare January 10, 2026 07:05
@zivkan zivkan force-pushed the dev-zivkan-dotnet-list-package-unlisted branch from 057bd9b to 5d6ba70 Compare January 11, 2026 21:09
@zivkan zivkan merged commit 43ba6f0 into dev Jan 14, 2026
17 of 18 checks passed
@zivkan zivkan deleted the dev-zivkan-dotnet-list-package-unlisted branch January 14, 2026 23:08
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.

No vulns shown for vulnerable & deprecated package version when using dotnet list package --vulnerable

4 participants