CmdID

CmdID / Commands

dotnet-add-package

Add or update a .NET package reference in a project file. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Add a package to the project in the current directory

dotnet add package packageIdentify

Add a package to a specific project

dotnet add path/to/file.csproj package packageIdentify

Add a specific version of a package to the project

dotnet add package package --version 1.0.0Identify

Add a package using a specific NuGet source

dotnet add package package --source https://api.nuget.org/v3/index.jsonIdentify

Add a package only when targeting a specific framework

dotnet add package package --framework net7.0Identify

Add and specify the directory where to restore packages (~/.nuget/packages by default)

dotnet add package package --package-directory path/to/directoryIdentify