dotnet-nuget-why - Man Page

Shows the dependency graph for a particular package.

dotnet nuget why

This article applies to: ✔️ .NET 8.0.4xx SDK and later versions

Synopsis

dotnet nuget why <PROJECT|SOLUTION> <PACKAGE> [-f|--framework <FRAMEWORK>]

dotnet nuget why -h|--help

Description

The dotnet nuget why command shows the dependency graph for a particular package for a given project or solution.

Starting with version 9.0.200, the command introduces support for runtime identifier (RID) specific packages by generating separate dependency trees for each RID and framework combination. For example, if a project targets net9.0 with the win-x64 RID, the command generates trees for net9.0/win-x64 and net9.0.

Older project format

To use the command with projects that can’t be restored with the .NET SDK, you can pass a NuGet assets file in place of the project file (starting with the .NET 9 SDK):

  1. First, restore the project in Visual Studio or using msbuild.exe. By default, the assets file is in the project’s obj\ directory, but you can find the location with msbuild.exe path\to\project.proj -getProperty:ProjectAssetsFile.
  2. Run dotnet nuget why path\to\project.assets.json SomePackage.

Arguments

Options

Examples

Info

2025-07-30 .NET Documentation