dotnet-add-package
Add or update a .NET package reference in a project file. tldr-pages
On several platforms
Several platforms
Add a package to the project in the current directory
dotnet add package packageIdentifyAdd a package to a specific project
dotnet add path/to/file.csproj package packageIdentifyAdd a specific version of a package to the project
dotnet add package package --version 1.0.0IdentifyAdd a package using a specific NuGet source
dotnet add package package --source https://api.nuget.org/v3/index.jsonIdentifyAdd a package only when targeting a specific framework
dotnet add package package --framework net7.0IdentifyAdd and specify the directory where to restore packages (~/.nuget/packages by default)
dotnet add package package --package-directory path/to/directoryIdentify