In my Nuget.config I have specified a repository path:
<config>
<add key="repositoryPath" value="C:\Shared\Packages" />
</config>
When I install a package it correctly places the exploded files in this directory.
If I enable the package restore capability it does not honor the "repositoryPath" and instead restores the packages to a packages folder in the same directory as the .sln file. This is problematic on a build server.
since my .csproj references expect those files to be in the "C:\Shared\Packages" directory and since they are not restored to the correct directory the build will fail.
Comments: Reopening this issue. There are two problems here A) If NuGet.config is placed in the project it doesn't read the settings. Repro: 1. create new console app 2. Create NuGet.config at project level. 3. add the repositorypath setting to point to c:\temp 4. Close and reopen the solution 5. install a package Actual: package is installed in default packages dir Expected: As per the doc it looks in the following order. .nuget\nuget.config Recursive walk from project folder to root Global nuget.config (%appdata%\NuGet\nuget.config) So it should have looked at the project folder, read the repostitorypath setting and downloaded the packages there B) It's a pain and not discover-able by many to close and reopen the solution to get the setting refreshed.
<config>
<add key="repositoryPath" value="C:\Shared\Packages" />
</config>
When I install a package it correctly places the exploded files in this directory.
If I enable the package restore capability it does not honor the "repositoryPath" and instead restores the packages to a packages folder in the same directory as the .sln file. This is problematic on a build server.
since my .csproj references expect those files to be in the "C:\Shared\Packages" directory and since they are not restored to the correct directory the build will fail.
Comments: Reopening this issue. There are two problems here A) If NuGet.config is placed in the project it doesn't read the settings. Repro: 1. create new console app 2. Create NuGet.config at project level. 3. add the repositorypath setting to point to c:\temp 4. Close and reopen the solution 5. install a package Actual: package is installed in default packages dir Expected: As per the doc it looks in the following order. .nuget\nuget.config Recursive walk from project folder to root Global nuget.config (%appdata%\NuGet\nuget.config) So it should have looked at the project folder, read the repostitorypath setting and downloaded the packages there B) It's a pain and not discover-able by many to close and reopen the solution to get the setting refreshed.