When adding NuGet packages to your .NET projects, it's important to understand the difference between direct dependencies and transitive dependencies.
Direct dependencies are the packages that are added directly as a package reference to your project file. For example in this Azure Function project, you see one direct dependency:
So knowing and managing your direct dependencies is quite easy. But this package has also dependencies that are not directly added to your project. These are the transitive dependencies.
To prevent supply-chain attacks, it is important to have a good understanding of the full dependency treed and know all packages that are used directly or indirectly in our projects.
Visual Studio helps you to see and manage these transitive dependencies by making them visible in the NuGet Package Manager:
You can hover over any transitive dependency to understand the top-level dependencies that brought it into your project:
And you can always promote a transitive dependency to a direct dependency by clicking on the Install arrow icon or the Install button: