3

I have a .NET solution with few projects. Each of these projects consume 1 or more Nuget packages. To each project, I have added a Nuget.config file which has this setting:

<config>
    <add key="repositoryPath" value=".\packages" />
  </config>

Intent is to install packages in project level packages folder. But when I install packges through Visual Studio package manager, they are still getting installed in solution level packages folder. These are project level packages as they have files in lib directories. So whenever I install them, packages.config file at the project level gets updated accordingly but the location is still at solution level.VS Package manager doesn't seem to read project level nuget.config at have destination folder at project level. Pls help.

Thanks

Sandeep

Sunny
  • 81
  • 7
  • 1
    Can you explain why you want to store packages per project? The default config is to have a shared package folder per solution. – Joe Niland Feb 22 '17 at 04:05
  • Hi Joe, this is a short term solution which we need to adopt till we are in our current version control system. Once we migrate to TFVC in couple of quarters, this limitation will go away. But as of now due to certain design constraints, we need to store packages at the project level. – Sunny Feb 22 '17 at 16:34
  • NuGet assumes packages should belong at the "solution" level. We can't use NuGet at our company for this reason. The problem is, if there are 2 development teams and they each have their own sln file but share a common proj then you might run into this issue. Such as a Web Team and Desktop Team sharing "Common.proj" and this shared project has NuGet packages. You can't assume that in both solutions the package folder is ".." for the current "Common.proj" path. The Common.proj file assumes the "packages" folder is always "..\packages\" but some teams don't share folder layouts. – goroth Mar 02 '17 at 20:26
  • This is a similar problem http://stackoverflow.com/questions/42292044/shared-projects-referencing-to-solution-level-nuget-packages – goroth Mar 02 '17 at 20:29
  • And here http://stackoverflow.com/questions/6277925/nu-get-issue-with-project-level-dependences-for-projects-referenced-by-multipl – goroth Mar 02 '17 at 20:41

0 Answers0