Reputation: 613
In our existing solution we have a NuGet.Config file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositorypath" value="NuGetPackages" />
</config>
</configuration>
With this config we tell NuGet to store all packages in the "NuGetPackages" folder. This works fine for all our existing Projects (WebApi, Libraries, ...), but if I add a new ASP.NET Core project, the packages are stored in the C:\Users\<username>\.dnx\packages
folder.
Is there a way to change the package folder on solution level?
Thanks!!
Upvotes: 4
Views: 2871
Reputation: 7504
You might need to use globalPackagesFolder
instead of repositoryPath
key as stated in NuGet documentation:
Note:
dependencyVersion
andrepositoryPath
apply only to projects usingpackages.config
.globalPackagesFolder
applies only to projects usingproject.json
and projects using the new Visual Studio 2017 project format.
Upvotes: 0
Reputation: 1883
Yeah, you can use the global.json
for that:
{
"packages": "NuGetPackages",
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
See: https://github.com/aspnet/Home/wiki/Package-Locations
Upvotes: 3