0

Whether using dotnet and paket from command line within project folder or utilising nuget from within Visual Studio 2019, the packages keep getting installed to c:\user\xyz.nuget\packages\ as if globally rather than locally in a folder within the project location. Is there a way to change this behaviour?!

Thanx

Sasha Babaei
  • 455
  • 3
  • 8

1 Answers1

0

Newer NuGet(VS 2015 and later) can install packages to one shared global location.

In more modern styles such as PackageReference, this is the consumption directory, packages are consumed from here by the build.

There is no lifetime management, think of it as your program files folder.

That being said, yes, you can easily change the global packages folder through a NUGet.config.

<configuration>
  <config>
    <add key="globalPackagesFolder" value="mypath\packages" />
  </config>
</configuration>

Reference docs, interesting reads:

imps
  • 1,423
  • 16
  • 22