NuGet

How to find outdated, deprecated and vulnerable NuGet packages with dotnet package list

The .NET CLI can tell you which NuGet packages in a project or solution are out of date, deprecated or have known vulnerabilities, including packages you only get indirectly. This guide shows the command (renamed dotnet package list in .NET 10), every useful option, how to read the output, and how to turn it into a JSON report for CI.

dotnet package list or dotnet list package? From the source

The .NET 10 SDK introduced noun-first command names, so the command is now dotnet package list. With the .NET 9 SDK or earlier, use the older form dotnet list package; the options are the same. The command works with the .NET 6 SDK and later.

Run it in a folder with one project or solution file, or pass --project with a project or solution path. From .NET 10 the command restores packages first if needed; with older SDKs, build or restore before running it. Add --no-restore to skip the restore.

At a glance · NuGet

9.0.300

dotnet package list or dotnet list package?The four questions it answersUseful optionsReady-to-use commandsPutting it in CI

The four questions it answers From the source

  • What do I reference? dotnet package list shows each top-level package with its Requested version (what the project file says, which can be a range) and its Resolved version (what was actually restored). (A) marks packages the SDK adds automatically.
  • What is out of date? --outdated adds a Latest column with the newest version on your package sources.
  • What is deprecated? --deprecated lists packages their authors have marked as deprecated.
  • What has a known vulnerability? --vulnerable lists packages with published security advisories. It is available from .NET SDK 9.0.300 and reads advisories from the AuditSources in your NuGet configuration, or from your package sources if none are set. It cannot be combined with --outdated or --deprecated.

Useful options From the source

  • --include-transitive: also lists packages you get through other packages. Most vulnerable dependencies hide here, so combine it with --vulnerable.
  • --highest-minor: only suggests newer versions with the same major version, which avoids breaking changes. --highest-patch is stricter and keeps the same major and minor version. Both need --outdated or --deprecated.
  • --include-prerelease: also considers preview versions when looking for newer packages.
  • -f or --framework: limits the report to one target framework, and can be repeated for several. The short -f form needs the .NET 9 SDK or later.
  • --source and --config: choose which NuGet sources to check for newer versions.
  • --format json: machine-readable output, available from .NET SDK 7.0.200. --output-version 1 fixes the JSON schema version.
  • --interactive: lets the command stop for sign-in to a private feed.

Ready-to-use commands Analysis

  • Weekly dependency check: dotnet package list --outdated --highest-minor shows safe, non-breaking updates first.
  • Security check: dotnet package list --vulnerable --include-transitive lists every vulnerable package, direct or indirect.
  • Plan a major upgrade: dotnet package list --outdated without --highest-minor shows how far behind the major versions are.
  • Clean-up: dotnet package list --deprecated finds packages you should replace even if they still work.
  • CI report: dotnet package list --include-transitive --vulnerable --format json writes a JSON report that a pipeline can save as an artifact or parse to fail the build.

Putting it in CI Analysis

Running these commands by hand once is useful; running them on every build is what keeps a project healthy. A simple approach is a scheduled pipeline job that runs the vulnerable and outdated reports in JSON, stores them, and fails or opens an issue when the vulnerable list is not empty. Because the output is JSON, you do not need to scrape console text.

NuGet restore can also warn about vulnerable packages on its own through NuGet Audit, so many teams treat the vulnerable report as the detailed follow-up rather than the only check. Whichever you use, fix transitive vulnerabilities by updating the top-level package that brings them in where possible, and add a direct reference to a patched version only when no fixed parent exists yet.

Keep the .NET SDK itself current too: the --vulnerable option needs SDK 9.0.300 or later, and .NET 8 and 9 have been out of support since 10 November 2026.

Sources and further reading

Original: “dotnet package list command”, Microsoft Learn, published 25 Nov 2026, retrieved 25 Nov 2026. This article was generated from the official source using our structured templates and passed automated quality checks. Spotted a mistake? See our corrections policy.