Visual Studio 2019 16.11.3 not pulling NuGet packages from TeamCity 2021.1 (build 92597)

On Windows Server 2016 (1607)

We're in the process of moving to new development machines. On these new machines, attempting to Restore NuGet packages from the TeamCity repository fails. It only fails when using the TeamCity-maintained repository, we do have a UNC share too, which works fine. The message we receive:

NuGet Package restore failed for project xxx.yyy.TestHarness.Windows.Console: Unable to find version '1.0.98' of package 'xxx.Infrastructure.zzz'.
\\ourteamcitybuildserver.vvv.local\NuGetFeed_Public: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source '\\ourteamcitybuildserver.vvv.local\NuGetFeed_Public'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source 'https://api.nuget.org/v3/index.json'.
http://ourteamcitybuildserver.vvv.local:8083/guestAuth/app/nuget/feed/_Root/default/v3/index.json: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source 'http://ourteamcitybuildserver.vvv.local:8083/guestAuth/app/nuget/feed/_Root/default/v3/index.json'.
http://ourteamcitybuildserver.vvv.local:8083/guestAuth/app/nuget/feed/_Root/default/v2: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source 'http://ourteamcitybuildserver.vvv.local:8083/guestAuth/app/nuget/feed/_Root/default/v2'.
https://ourteamcitybuildserver.zzz.local:8085/guestAuth/app/nuget/feed/_Root/default/v2: Package 'xxx.Infrastructure.zzz.1.0.98' is not found on source 'https://ourteamcitybuildserver.vvv.local:8085/guestAuth/app/nuget/feed/_Root/default/v2'.

We've obfuscated with xxx, yyy, zzz and vvv.

This _used_ to work fine on our old machines. With differing versions of VS 2019 from 16.1.5 to 16.11.3. In our investigations, we're using all 3 supported versions of the NuGet feed URL.

We use SSL so have IIS as a Reverse Proxy (providing the SSL) on 8085, which proxies to TeamCity's 8083. We can access 8085 and 8083 using web browsers and the Fiddler tool and get valid results. But Visual Studio fails to restore.

Please advise if there's anything else I can provide. This appears to be specific to Visual Studio communicating with the TeamCity NuGet repo. It communicates with NuGet fine. We are able to prove communication outside of the Visual Studio flow fine. It fails using PackageReference or packages.config methods.

Thank you for your time.

 

Nathan

0
3 comments

More information:

NuGet version 5.1 WORKS

NuGet version 5.11.0, 6.0.0.275 does NOT work.

A colleague is reporting the following:

0

Restarting server didn't fix.

Using Rider 2021.2.2 also has issue.

Start restoring packages for solution
@ Restoring packages in solution xxx.yyy started
@ RestorePackagesConfig: Start
@ There are 20 packages in solution: log4net.2.0.12, Microsoft.AspNet.Razor.3.2.7, Microsoft.AspNet.WebApi.Client.5.2.7, Microsoft.Bcl.1.1.10, Microsoft.Bcl.Build.1.0.21, Microsoft.Net.Http.2.2.29, Newtonsoft.Json.13.0.1, Ninject.3.3.4, xxx.yyy.zzz.Message.2.1.0.18, xxx.yyy.zzz.Factory.2.6.59, xxx.Infrastructure.vvv.4.10.112, zzz.Infrastructure.www.4.6.90, xxx.Infrastructure.ttt.3.2.10, xxx.Infrastructure.sss.5.2.15, xxx.SCC.1.5.87.5997, xxx.Services.rrr.1.3.49.6280, xxx.Services.uuu.1.1.32.6218, xxx.Windows.Services.1.1.23, RazorEngine.3.10.0, xxx.yyy.zzz.Model.2.6.59
@ We are going to restore 11 packages because they are missing: xxx.yyy.zzz.Message.2.1.0.18, xxx.yyy.zzz.Factory.2.6.59, xxx.Infrastructure.vvv.4.10.112, xxx.Infrastructure.www.4.6.90, xxx.Infrastructure.ttt.3.2.10, xxx.Infrastructure.sss.5.2.15, xxx.SCC.1.5.87.5997, xxx.Services.uuu.1.3.49.6280, xxx.Services.qqq.1.1.32.6218, xxx.Windows.Services.1.1.23, xxx.yyy.zzz.Model.2.6.59
@@@ Restoring package xxx.yyy.zzz.Message 2.1.0.18 .NETFramework,Version=v4.7.2 started
Restoring NuGet package xxx.yyy.zzz.Message.2.1.0.18.
GET https://ourteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1/Packages(Id='xxx.yyy.zzz.Message',Version='2.1.0.18')
NotFound https://ourteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1/Packages(Id='xxx.yyy.zzz.Message',Version='2.1.0.18') 57ms
GET https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1/FindPackagesById()?id='xxx.yyy.zzz.Message'&semVerLevel=2.0.0
OK https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1/FindPackagesById()?id='xxx.yyy.zzz.Message'&semVerLevel=2.0.0 7ms
GET http://outteamcityserver:8083/guestAuth/app/nuget/feed/_Root/default/v3/flatcontainer/xxx.yyy.zzz.message/2.1.0.18/xxx.yyy.zzz.message.2.1.0.18.nupkg
NotFound http://outteamcityserver:8083/guestAuth/app/nuget/feed/_Root/default/v3/flatcontainer/xxx.yyy.zzz.message/2.1.0.18/xxx.yyy.zzz.message.2.1.0.18.nupkg 10ms
GET https://api.nuget.org/v3-flatcontainer/xxx.yyy.zzz.message/2.1.0.18/xxx.yyy.zzz.message.2.1.0.18.nupkg
NotFound https://api.nuget.org/v3-flatcontainer/xxx.yyy.zzz.message/2.1.0.18/xxx.yyy.zzz.message.2.1.0.18.nupkg 410ms
Unable to find version '2.1.0.18' of package 'xxx.yyy.zzz.Message'.
\\outteamcityserver\NuGetFeed_Public: Package 'xxx.yyy.zzz.Message.2.1.0.18' is not found on source '\\outteamcityserver\NuGetFeed_Public'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'xxx.yyy.zzz.Message.2.1.0.18' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1: Package 'xxx.yyy.zzz.Message.2.1.0.18' is not found on source 'https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v1'.
https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v3/index.json: Package 'xxx.yyy.zzz.Message.2.1.0.18' is not found on source 'https://outteamcityserver:8085/guestAuth/app/nuget/feed/_Root/default/v3/index.json'.
https://api.nuget.org/v3/index.json: Package 'xxx.yyy.zzz.Message.2.1.0.18' is not found on source 'https://api.nuget.org/v3/index.json'.

You can see the communication on HTTPS/8085 going to HTTP/8083 based on the feed response, which contains the HTTP/8083 URLs.

 

0

Fixed this.

FLushed the buildArtefacts cache despite restarts, a yellow banner and constant Googling not turning anything up.

 

0

Please sign in to leave a comment.