Is there a way to configure Paket to share a Nuget packages folder across repositories?

191 Views Asked by At

The use case here is that we have a bunch of repositories for small applications that use similar sets of dependencies. They all do different things, and if each application has it's own packages folder it ends up eating up a ton of space on disk. I've tried creating a NuGet.config file with a repositoryPath. It doesn't seem to respect that, but I could be doing something wrong...

Is there a (correct) way to have paket share a packages folder across multiple repos?

1

There are 1 best solutions below

1
On
  1. The NuGet.config should work but you need to close and re-open the solution. Also make sure that you are using at least VS 2015 update 3 with the latest 3.5 NuGet VSIX (or gt it from NuGet's download page)

  2. In Visual Studio 2017 (> 15.1) you can use the new PackageReference type that no longer uses a packages.config file but embeds the referenced package information into the csproj file. This method uses a global packages cache by default and you don't need to add a NuGet.config file. See NuGet's blog post for details, especially the section "What about other project types that are not .NET Core?" (not that the blog post was written before the feature became generally available).