When looking up the location that the NuGet packages are stored we noticed that some of the dlls were stored at C:\Users\Username\.nuget\packages
while others were stored at C:\Program Files\dotnet\sdk\NuGetFallbackFolder
.
For example, the microsoft.aspnetcore.all package folder is present in both directories on my dev pc (C:\Users\Username\.nuget\packages
contains 2.0.7 and 2.1.0, while C:\Program Files\dotnet\sdk\NuGetFallbackFolder
contains 2.0.0, 2.0.3, 2.0.5, 2.0.6 and 2.0.8).
According to the book "C# 7 and .NET Core 2.0 High Performance" by Ovais Mehboob Ahmed Khan. The default path should be C:\Users\Username\.nuget\packages
.
Why are the files separated into the different folders?
Note: We are referencing microsoft.aspnetcore.all version 2.0.8 in most of our projects. Most of the other packages we reference in our projects alternate between the two folders.
NuGetFallbackFolder contains a cache of NuGet packages used by an SDK during the dotnet restore step
. The other folder is for NuGet packages used by a project that are not included with the .NET Core SDK and for projects that do not use the NuGetFallbackFolder, such as non .NET Core projects. – Matt Ward