I've created a solution with one project in VS2017. It is a .Net C# Winforms Application. I want the project to load in the nuget packages that have been downloaded earlier by other projects into a certain folder on my computer and add them to its references.
The packages folder is located one directory back from the solution directory.
How could I achieve this?
I've already tried adding a nuget.config
file to the solution location that contains the following XML code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value="..\packages" />
<add key="repositoryPath" value="..\packages" />
</config>
</configuration>
My solution seemed to ignore it completely even after including it in the VS solution explorer.
I've also read that globalPackagesFolder
is overridden by NUGET_PACKAGES
(or something along those lines) environmental variable, so what is the point of setting it in the .config
file? Or am I not understanding something correctly?
Also, a little bit off topic, but still, I am really curious. When I click 'Manage nuget packages' on my project and download something those packages are placed one directory before the .csproj
file of my project. Can I change where these packages for that particular project are being downloaded to (and pulled from into the references of my project)?