From 330b0baf4f5cabc04f81e612296d87dc0183b05d Mon Sep 17 00:00:00 2001 From: Andy Zivkovic Date: Fri, 3 Oct 2025 15:05:09 +0930 Subject: [PATCH 1/3] dotnet nuget why has optional project argument --- docs/core/tools/dotnet-nuget-why.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/core/tools/dotnet-nuget-why.md b/docs/core/tools/dotnet-nuget-why.md index eb0cf8feebabf..a600e24323fe1 100644 --- a/docs/core/tools/dotnet-nuget-why.md +++ b/docs/core/tools/dotnet-nuget-why.md @@ -15,7 +15,7 @@ ms.date: 05/30/2024 ## Synopsis ```dotnetcli -dotnet nuget why [-f|--framework ] +dotnet nuget why [] [-f|--framework ] dotnet nuget why -h|--help ``` @@ -38,7 +38,10 @@ To use the command with projects that can't be restored with the .NET SDK, you c - **`PROJECT|SOLUTION`** - The project or solution file to operate on. If a directory is specified, the command searches the directory for a project or solution file. If more than one project or solution is found, an error is thrown. + The project or solution file to operate on. + If a directory is specified, the command searches the directory for a project or solution file. + If more than one project or solution is found, an error is thrown. + If no value is provided, the current working directory is used by default. - **`PACKAGE`** @@ -54,22 +57,22 @@ To use the command with projects that can't be restored with the .NET SDK, you c ## Examples -- Show the dependency graph for the package "System.Text.Json" for a given solution: +- Show the dependency graph for the package "System.Text.Json": ```dotnetcli - dotnet nuget why .\DotnetNuGetWhyPackage.sln System.Text.Json + dotnet nuget why System.Text.Json ``` ![Example: Solution with multiple projects](media/dotnet-nuget-why/dotnet-nuget-why-solution-with-multiple-projects.png) -- Show the dependency graph for the package "System.Text.Json" for a single project: +- Show the dependency graph for the package "System.Text.Json" for a specific project: ```dotnetcli - dotnet nuget why .\DotnetNuGetWhyPackage.csproj System.Text.Json + dotnet nuget why path\to\DotnetNuGetWhyPackage.csproj System.Text.Json ``` - Show the dependency graph for a specific target framework: ```dotnetcli - dotnet nuget why .\DotnetNuGetWhyPackage.csproj System.Text.Json --framework net6.0 + dotnet nuget why System.Text.Json --framework net6.0 ``` From 3e3ba5d664d4a7d24803496c6989a221ceaf0ce8 Mon Sep 17 00:00:00 2001 From: Andy Zivkovic Date: Fri, 3 Oct 2025 15:07:43 +0930 Subject: [PATCH 2/3] Apply suggestion from @zivkan --- docs/core/tools/dotnet-nuget-why.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-nuget-why.md b/docs/core/tools/dotnet-nuget-why.md index a600e24323fe1..df0866682e682 100644 --- a/docs/core/tools/dotnet-nuget-why.md +++ b/docs/core/tools/dotnet-nuget-why.md @@ -68,7 +68,7 @@ To use the command with projects that can't be restored with the .NET SDK, you c - Show the dependency graph for the package "System.Text.Json" for a specific project: ```dotnetcli - dotnet nuget why path\to\DotnetNuGetWhyPackage.csproj System.Text.Json + dotnet nuget why path/to/DotnetNuGetWhyPackage.csproj System.Text.Json ``` - Show the dependency graph for a specific target framework: From 9c373506a58eb2b1fbb040f968f51453cd0f350f Mon Sep 17 00:00:00 2001 From: "Meaghan Osagie (Lewis)" Date: Fri, 3 Oct 2025 10:30:27 -0700 Subject: [PATCH 3/3] Update docs/core/tools/dotnet-nuget-why.md --- docs/core/tools/dotnet-nuget-why.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-nuget-why.md b/docs/core/tools/dotnet-nuget-why.md index df0866682e682..fff89d4a24957 100644 --- a/docs/core/tools/dotnet-nuget-why.md +++ b/docs/core/tools/dotnet-nuget-why.md @@ -38,7 +38,7 @@ To use the command with projects that can't be restored with the .NET SDK, you c - **`PROJECT|SOLUTION`** - The project or solution file to operate on. + The project or solution file to operate on. If a directory is specified, the command searches the directory for a project or solution file. If more than one project or solution is found, an error is thrown. If no value is provided, the current working directory is used by default.