I\'m having troubles with NuGet package restoring during a TFS Build 2015.
Since some packages require NuGet 3.x client, I\'ve configured the new scriptable build to
If for some reason updating the NuGet.config
in the Roaming folder is not an option or unwanted, it is also possible to add the config file to the solution root.
According to the docs:
Config file locations and uses
In my case, the issue was that user-wide NuGet.config
located at C:\Users\[User name]\AppData\Roaming\NuGet\NuGet.config
(where [User name]
is the user who's running the build agent's Windows service) was pointing to NuGet API v2 while my build is already using NuGet Command-Line 3.x.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<!-- CHANGING V2 TO V3 IN THE URI VALUE SOLVED THE ISSUE! -->
<add key="nuget.org" value="https://www.nuget.org/api/v3/" />
</packageSources>
</configuration>
In my case the Nuget.Config
, was in:
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\NuGet
So search for Nuget.Config
in your C:\
.
The user depends on the account that you configured the Agent