Change NuGet global package folder path

It spent me 3 hours to find a way to change the default NuGet global package folder path. Finally I end up following solution:

  • Add a NuGet.Config to the root of the project folder.
  • Add following contents to the NuGet.Config file:
<?xml version="1.0" encoding="utf-8"?>
     <add key="globalPackagesFolder" value="E:\nuget\packages" />

The most important thing is use globalPackagesFolder instead of repositoryPath.


Written on August 29, 2017