TeamCity does not restore NuGet packages from a specific package source

I recently added a bunch of Sitecore NuGet packages for my solution from my new NuGet server: https://sitecore.myget.org/F/sc-packages/api/v3/index.json

But TeamCity seems unable to download them:

[12:45:16][restore] Unable to find version '8.1.160302' of package 'Sitecore.ContentSearch.Linq.NoReferences'.
[12:45:16][restore] Unable to find version '8.1.160302' of package 'Sitecore.ContentSearch.NoReferences'.
[12:45:16][restore] Unable to find version '8.1.160302' of package 'Sitecore.Kernel'.
[12:45:16][restore] Unable to find version '8.1.160302' of package 'Sitecore.Kernel.NoReferences'.

I changed the list of package sources at my NuGet Installer build stage, so the Sitecore source is the only one, but it still cannot restore these. Dll. (As a side note: I was expecting other packages to fail now because their source has been removed, but there is no error for them?)

Looking at the logs, I see that the command starts, which looks right:

C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.8.6\tools\NuGet.exe restore C:\TeamCity\buildAgent\work\52ce411043f6b04c\MySolution.sln -Source https://sitecore.myget.org/F/sc-packages/api/v3/index.json
+4
1

Nuget v3, , TeamCity Nuget Nuget.exe v2.8.6. , v3 +:

Nudget Settings

TeamCity Nuget.config .sln . , Visual Studio, . TeamCity .

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="Sitecore NuGet Feed" value="https://sitecore.myget.org/F/sc-packages/api/v3/index.json" />
    <add key="Custom Server" value="http://my-custom-server.org/api/v3/" />
  </packageSources>
</configuration>

NuGet.

+5

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


All Articles