I have a class library project which is reused across different solutions. I would like NuGet to add a toolkit reference to the class library project and store it in the project folder not in the solution folder.
Example:
I have
D:\Projects\MyClassLibrary
D:\Projects\Solution1
D:\Projects\Solution2
Using NuGet, I want to add a toolkit to the MyClassLibrary project.
Right now, if I have Solution1 open, NuGet is adding the toolkit to
D:\Projects\Solution1\packages
I would like to tell NuGet to install the toolkit in the MyClassLibrary\packages
folder instead.
How to do this?
You can change the default packages folder location since nuget 2.1:
<configuration>
<config>
<add key=" repositoryPath" value=" C:\myteam\teampackages" />
</config>
...
</configuration>
reference: Specify ‘packages’ Folder Location
-----------------UPDATE-------------------------
you have to enable nuget automatic package restore for the solution.
When you do it nuget create a .nuget
folder in the solution root.
Inside that folder there are the file NuGet.Config
where you can put this configuration.
-----------------(last) UPDATE 2020-------------------------
nuget has changed since and this answer does not apply anymore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With