I’m looking for a way to use NuGet packages in projects which are included in multiple visual studio solutions.
Example: I’ve two solutions App1 and App2 both include a class library SharedProj. The structure looks like this:
├───App1
│ ├───App1
│ └───packages
│ └───NLog
├───App2
│ ├───App2
│ └───packages
│ └───NLog
└───SharedProj
├───packages.config
When I install a package to SharedProj it gets added to the packages.config. So far so good…
The problem is, the package will be installed into the packages directory of the open solution.
<Reference Include="Extend, Version=4.2.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\App1\packages\NLog\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
For example, if the App1 solution is open the packages gets added to App1\packages. => A project from the App2 solution references a package from the App1 solution. Which means I ‘m not able to build App2 until I’ve restored the packages of App1.
How can I get NuGet to work in such a scenario?