At this time when I add a NuGet package to my project using the 'Manage NuGet Packages' option in Visual Studio 2012 (using the GUI not the Package Manager Console') the packages get 'installed' in the folder '$SolutionDir\packages'.
I would like to change the destination folder for the NuGet packages to a different folder than the default '$SolutionDir\packages'.
The reason for this is :
I have various projects that I use in different solutions (for the same application). I have added NuGet packages to this project in say Solution1, if I later try and do a TFS build for Solution2 wich also contains this project the build fails because the compiler tries to resolve the project references in 'Solution1\Packages' and NuGet packages are restore at build time at 'Solution2\Packages'. I have resolved that by changing the NuGet.Targets file in the various solutions so that all Solutions have the same packages folder, this works great but... here's the catch :
If I now change or add a package to my project in vs2012 using a right-click on my project and selecting 'Manage NuGet Packages' the new package is again put in the '$Solutiondir\packages' and not in the folder I specified in the NuGet.Targets, appearently the 'Manage NuGet Packages' dialog doesn't use this NuGet.Targets file within the .nuget folder of the solution. I did notice the Settings button on the Left-bottom part of the Dialog but cannot configure this setting here.
thanks,
Jurjen.
Comments: I have now changed the location of my packages (PackagesDir property) in the $SolutionDir\.nuget\nuget.targets file. I've also now changed all my project references to the same location ($SolutionDir\..\..\_packages), this works just fine. However VS2012 is not getting this change, when I want to do an update-package, nothing happens and right-click on a project and trying to update any package using the 'Manage Nuget Package' UI in vs2012 doesn't seem to work anymore. In visual studio the 'package-manager console' and 'Manage Nuget Package' are both telling me that 'some packages are missing from my solution', this leads me to believe that visual studio is looking at a completely different location for the packages It's really frustrating that this doesn't seem to work, am I doing something wrong or is this scenario just not supported (yet) by visual studio ? I can't find a blog-post of piece of documentation clearly explaining to me what it is I have to do/configure to get this working. Jurjen.
I would like to change the destination folder for the NuGet packages to a different folder than the default '$SolutionDir\packages'.
The reason for this is :
I have various projects that I use in different solutions (for the same application). I have added NuGet packages to this project in say Solution1, if I later try and do a TFS build for Solution2 wich also contains this project the build fails because the compiler tries to resolve the project references in 'Solution1\Packages' and NuGet packages are restore at build time at 'Solution2\Packages'. I have resolved that by changing the NuGet.Targets file in the various solutions so that all Solutions have the same packages folder, this works great but... here's the catch :
If I now change or add a package to my project in vs2012 using a right-click on my project and selecting 'Manage NuGet Packages' the new package is again put in the '$Solutiondir\packages' and not in the folder I specified in the NuGet.Targets, appearently the 'Manage NuGet Packages' dialog doesn't use this NuGet.Targets file within the .nuget folder of the solution. I did notice the Settings button on the Left-bottom part of the Dialog but cannot configure this setting here.
thanks,
Jurjen.
Comments: I have now changed the location of my packages (PackagesDir property) in the $SolutionDir\.nuget\nuget.targets file. I've also now changed all my project references to the same location ($SolutionDir\..\..\_packages), this works just fine. However VS2012 is not getting this change, when I want to do an update-package, nothing happens and right-click on a project and trying to update any package using the 'Manage Nuget Package' UI in vs2012 doesn't seem to work anymore. In visual studio the 'package-manager console' and 'Manage Nuget Package' are both telling me that 'some packages are missing from my solution', this leads me to believe that visual studio is looking at a completely different location for the packages It's really frustrating that this doesn't seem to work, am I doing something wrong or is this scenario just not supported (yet) by visual studio ? I can't find a blog-post of piece of documentation clearly explaining to me what it is I have to do/configure to get this working. Jurjen.