Is it possible to change the name and the path of the created nuget package directory?
My current folder structure is like this:
+src
++Project1
++Project2
++packages
I'd like to have a folder structure like this:
+Lib (packages)
+src
++Project1
++Project2
You can do this by creating a file called nuget.config
and storing it in the same location as your solution file.
The config file should look like this:
<settings>
<repositoryPath>../libs/packages</repositoryPath>
</settings>
That's it.
Obviously you can put whatever path you want. Hope that helps.
I did it for VS 2010.
1) Get NuGet updated.
2) Add a nuget.config file to the solution folder like this:
<?xml version="1.0" encoding="utf-8"?>
<settings>
<repositoryPath>..\..\..\Dependencies\packages</repositoryPath>
</settings>
3) Create an empty "packages" folder at the location referred by the nuget.config file.
4) Go to Tools -> Library Package Manager-> Manage Nuget Packages for Solution
5) Type "asynctargetingpack" on the search box (or any other package you prefer)
6) Install the package
7) Go to the "packages" folder at the location referred by the nuget.config file and check the package files are there.
Starting with version 2.2 you can changed the NuGet.Config file.
NuGet Configuration File
Edit the value of the "repositorypath" key (and uncomment).
This limitation is on the VS plugin, using the command line you can choose the packages directory for the install/update commands, but then you can't go back to use the plugin UI.
精彩评论