I have a directory structure like -
Projects .nuget NuGet.exe NuGet.config NuGet.targets **packages (I want to download package for different solution HERE ONLY)** Sources Applications App1 App1.sln (Solution File) **packages (NuGet downloads packages here first then copies to expected folder, WHY??)** App1 (Porject Directory) App1.csproj App2 App2.sln (Solution File) **packages (NuGet downloads packages here first then copies to expected folder, WHY??)** App2 (Porject Directory) App2.csproj
I reference the .nuget folder in each solution using the following code
Project("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}") = ".nuget", ".nuget", "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx}" ProjectSection(SolutionItems) = preProject ..\..\..\.nuget\NuGet.Config = ..\..\..\.nuget\NuGet.Config ..\..\..\.nuget\NuGet.exe = ..\..\..\.nuget\NuGet.exe ..\..\..\.nuget\NuGet.targets = ..\..\..\.nuget\NuGet.targets EndProjectSection EndProject
In each project file (.csproj), I reference the common NuGet.targets using
<Import Project="..\..\..\..\.nuget\NuGet.targets" Condition="Exists('..\..\..\..\.nuget\NuGet.targets')" />
In NuGet.config, I added the following line so that it (should) copy packages only to the EXPECTED folder
<add key="repositoryPath" value="..\packages" />
I have mapped the Projects folder to TFS and it asks me to add files in both locations due to the above problem.
source share