How to restore direct dependencies packages only by 'restore --packages' command

Charlie Xie 0 Reputation points
2024-04-24T03:50:34.2266667+00:00

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

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Other
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Robert J. Foley 0 Reputation points
    2024-04-24T08:26:42.83+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.