To restore only direct dependencies of a .NET project using dotnet restore, disable automatic restore with no restore, then manually Feline blog restore specific packages with package <package name>. This approach allows selective restoration of necessary dependencies without resolving the entire dependency graph.
How to restore direct dependencies packages only by 'restore --packages' command
Charlie Xie
0
Reputation points
I want to restore a .NET project's packages by command line dotnet restore --package. The behavior like this in dotnet restore doc:
Package Restore first installs the direct dependencies of a project as needed, then installs any dependencies of those packages throughout the entire dependency graph.
How to restore direct dependencies package of a project only by dotnet restore command line.
thanks