There is no more packages
solution folder in any csproj
or project.json
-based .NET Core project.
NuGet CLI gets the list of used cache folders:
nuget locals all -list
Response:
http-cache: C:\Users\<foo>\AppData\Local\NuGet\v3-cache
global-packages: C:\Users\<foo>\.nuget\packages\
temp: C:\Users\<foo>\AppData\Local\Temp\NuGetScratch
How to change or override these locations?
From the MS docs:
global‑packages
Override using the NUGET_PACKAGES environment variable, the globalPackagesFolder or repositoryPath configuration settings (when using PackageReference and packages.config, respectively), or the RestorePackagesPath MSBuild property (MSBuild only). The environment variable takes precedence over the configuration setting.
Cache locations
Solution-local packages folders are no longer exist for .NET Core and Visual Studio 2017.
NuGet is now fully integrated into MSBuild:
NuGet 4.0+ uses at least two global package locations:
%userprofile%\.nuget\packages\
%ProgramFiles(x86)%\Microsoft SDKs\NuGetPackages\"
You can list all user-specific folders using the following console command:
Notice that the machine-wide folder isn't listed there. However, it is defined at Visual Studio settings:
Configuration files
NuGet.config
files are located here:%APPDATA%\NuGet\
%ProgramFiles(x86)%\NuGet\Config\
It is possible to change and override NuGet settings at many levels:
And even more! Read more about
NuGet.config
hierarchical priority ordering here: How settings are applied.For example,
globalPackagesFolder
parameter changes a package cache location. Look at thisNuGet.config
example: