nuget
This is an old revision of the document!
Table of Contents
NuGet
Commands
dotnet restore .\SomeProject.csproj | Restore NuGet packages by command line. |
dotnet list .\SomeProject.csproj package | List NuGet package dependencies of a project. |
dotnet list .\SomeProject.csproj package --include-transitive | List NuGet package dependencies of a project with transitive dependencies. |
dotnet list .\SomeSolution.sln package --include-transitive | List NuGet package dependencies of a solution with transitive dependencies. |
$pkgId = "newtonsoft.json" $version = "13.0.3" "https://api.nuget.org/v3-flatcontainer/$pkgId/$version/$pkgId.nuspec" | (Open URI in browser - Invoke-RestMethod does not seem to work). List NuGet package dependencies from a repo. Not sure if this actually works. |
dotnet nuget list source --format detailed | List the NuGet package sources. |
NuGet Source Locations
Scope | Location | Notes |
---|---|---|
User-level | %APPDATA%\NuGet\NuGet.Config | |
Machine-level | %ProgramFiles(x86)%\NuGet\Config\NuGet.Config | Less common. |
Project-level | Any NuGet.Config file in your solution or project directory. |
List them with the nuget sources list
command.
Package Cache Locations
%userprofile%\.nuget\packages
%userprofile%\AppData\Local\NuGet
nuget.1760668581.txt.gz · Last modified: 2025/10/17 02:36 by stephen