Nuget Configuration in ASP.NET Core 1.0

In our existing solution, we have a NuGet.Config file with the following contents:

<?xml version="1.0" encoding="utf-8"?> 
<configuration>   
    <solution>
        <add key="disableSourceControlIntegration" value="true" />           
    </solution>
    <config>
        <add key="repositorypath" value="NuGetPackages" />
    </config> 
</configuration>

In this config, we tell NuGet to store all the packages in the "NuGetPackages" folder. This is great for all of our existing projects (WebApi, Libraries, ...), but if I add a new ASP.NET Core project, the packages will be stored in a folder C:\Users\<username>\.dnx\packages.

Is there a way to change the package folder at the solution level?

Thank!!

+4
source share
2 answers

Yes, you can use global.jsonfor this:

{
  "packages": "NuGetPackages",
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-rc1-update1"
  }
}

See: https://github.com/aspnet/Home/wiki/Package-Locations

+3

, globalPackagesFolder repositoryPath, NuGet:

: dependencyVersion repositoryPath , packages.config. globalPackagesFolder project.json , Visual Studio 2017.

0

All Articles