-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for the 'dotnet nuget why' command #41472
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0119ad8
add dotnet nuget why docs
advay26 34f3c33
cleaning up and removing unnecessary example images
advay26 d877dcc
fix release version
advay26 d8cd799
add newline at the end of the file
advay26 9987c11
path argument phrasing
advay26 4215c57
address feedback
advay26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: dotnet nuget why command | ||
description: Shows the dependency graph for a particular package for a given project or solution. | ||
author: advay26 | ||
ms.date: 05/30/2024 | ||
--- | ||
# dotnet nuget why | ||
|
||
**This article applies to:** ✔️ .NET 8.0.4xx SDK and later versions | ||
|
||
## Name | ||
|
||
`dotnet nuget why` - Shows the dependency graph for a particular package. | ||
|
||
## Synopsis | ||
|
||
```dotnetcli | ||
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. | ||
|
||
## Arguments | ||
|
||
- **`PROJECT|SOLUTION`** | ||
|
||
A path to a project file, solution file, or directory. 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. | ||
tdykstra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- **`PACKAGE`** | ||
|
||
The package name to lookup in the dependency graph. | ||
tdykstra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Options | ||
|
||
- **`-f|--framework <FRAMEWORK>`** | ||
|
||
The target framework(s) for which dependency graphs are shown. You can pass multiple `--framework` options to see graphs for more than one framework. | ||
|
||
[!INCLUDE [help](../../../includes/cli-help.md)] | ||
|
||
## Examples | ||
|
||
- Show the dependency graph for the package "System.Text.Json" for a given solution: | ||
|
||
```dotnetcli | ||
dotnet nuget why .\DotnetNuGetWhyPackage.sln 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: | ||
|
||
```dotnetcli | ||
dotnet nuget why .\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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+86.5 KB
...ols/media/dotnet-nuget-why/dotnet-nuget-why-solution-with-multiple-projects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@advay26 This version looks wrong, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Youssef1313 We have a bug where it's not showing up in
dotnet nuget --help
, because of an incomplete transition to a different CLI parsing library:but if you run
dotnet nuget why
anyway, you'll see why's help (after error messages talking about missing required arguments)Otherwise, please explain why you think it's the wrong version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work for me with .NET 9 SDK Preview 4 but worked with preview 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET 9 P4 came out in May, whereas
8.0.400 and.NET 9 P6 came out in July. 8.0.400 isn't out yet. Basically, it's a new feature.I'll leave it up to the .NET team to decide if they want to update the docs to mention which pre-release version of .NET 9 the feature is available. My opinion is that once .NET 9 goes GA, it won't be relevant any longer and the NuGet team at least doesn't have dedicated docs writer resources to help us keep docs up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification. I agree the exact preview isn't very relevant.