Skip to main content

dotnet nuget

warning

This document has been translated using machine translation without human review.

dotnet nuget — represents the integration of NuGet into dotnet.

How to add a NuGet package source?​

Remote source
dotnet nuget add source https://example.org --name "Source name"
Source with authentication
dotnet nuget add source https://example.org --name "Source name" -u "username" -p "password"
Local folder
dotnet nuget add source "C:\packages" --name "Source name"

How to view the list of sources?​

dotnet nuget list source

How to disable package signature verification?​

To disable NuGet package signature verification, you can use the environment variable DOTNET_NUGET_SIGNATURE_VERIFICATION:

Windows
set DOTNET_NUGET_SIGNATURE_VERIFICATION=false
dotnet restore
Linux
export DOTNET_NUGET_SIGNATURE_VERIFICATION=false && dotnet restore

How to clear the NuGet cache?​

dotnet nuget locals all --clear

How to restore packages?​

dotnet restore

How to view package dependencies?​

dotnet nuget why <PROJECT_OR_SOLUTION_FILE> <PACKAGE_NAME>

How to add a NuGet package to a project?​

dotnet package add <PACKAGE_NAME>

How to remove a NuGet package from a project?​

dotnet package remove <PACKAGE_NAME>