We are developing multiple solutions in Visual Studio 2015. The solutions share some core projects that need nuget packages. The nuget references cannot be resolved when the nug
To resolve the issue, we put a NuGet.config file into the Codebase
directory then deleted all the other Nuget.config files and .nuget folders in the solutions. Since NuGet configurations are propagated to sub folders, the settings in the single NuGet.config file are applied into all the solutions.
Inside the Nuget.config file we put the packageSource
, repositoryPath
settings.
Example NuGet.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<config>
<add key="repositoryPath" value="./SharedPackages" />
</config>
</configuration>
Existing nuget packages need to be uninstalled and reinstalled since the dll references in .csproj files will still show the old packages
folder. Or you can manually edit the .csproj files.
Resulting folder structure: