NuGet 3.5 / Visual Studio 2015 - changing package cache location

Is it possible to change the nuget package cache path from %UserProfile%\.nuget\packagesto a user location?

I tried using the NuGetCachePath environment variable, but it doesn't seem to work with it.

+4
source share
3 answers

You can change the location of the package cache by setting the environment variable named NUGET_PACKAGES.

For example, change your location from C:\Users\Frank\.nuget\packagesto F:\Users\Frank\.nuget\packagesby setting the last value in the "system" environment variable with the name NUGET_PACKAGESand rebooting.

Link: https://github.com/NuGet/Home/issues/1905

+2

, . "NuGetCachePath", , MonoDevelop Linux: mrward/nuget.

+1

, , , , %APPDATA%\NuGet\NuGet.Config ( ).

, , , repositoryPath , HintPath .csproj ( , -net-core ). .csproj, , , .

, / :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <config>
        <add key="repositoryPath" value="D:\Cache\NuGet2\packages" />
    </config>
    <!-- More settings follow -->
-1

Source: https://habr.com/ru/post/1650200/


All Articles