vs2019 cannot use TeamCity NuGet Feed

Completed

We have setup a nuget feed on one of our projects. The build is running, the nuget package is published to the nuget feed of TeamCity.

But now we are unable to connect VS2019 to the TeamCity NuGet Feed.

We have tried the following sources:

  • http://<teamcityUrl>/<authSchema>/app/nuget/feed/<projectName>/<feedName>/v1
  • http://<teamcityUrl>/<authSchema>/app/nuget/feed/<projectName>/<feedName>/v2
  • http://<teamcityUrl>/<authSchema>/app/nuget/feed/<projectName>/<feedName>/v3/index.json

When we open the URL's in the browser, we see for V1 and V2 a XML scheme. For V3 we see the json output.
When we browse to /packages for V1 and V2, we see our package.

When we try to connect VS2019 through packages resources, we are unable to search our own package. 
VS returns the following error message:


Severity Code Description Project File Line Suppression State
Error [TC NuGet] The V2 feed at '<ONE OF THE ABOVE MENTIONED URLS>/Search()?$filter=IsLatestVersion&searchTerm='<PACKAGE NAME TO SEARCH FOR>'&targetFramework=''&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '401 '.

What are we doing wrong ?
What do we need to enter in VS to be able to search our package and include in our project(s)?

 

 

0
2 comments

Hi!

Status code '401' means the credentials you provided for the TeamCity NuGet feed are invalid. I believe, Visual Studio saves them in Windows Credentials Manager.

You can verify if you can search through the packages in the feed using NuGet CLI:

nuget list <PACKAGE ID> -source <ONE OF THE ABOVE MENTIONED URLS>

I hope this helps.

-Anatoly 

1

Thanks, that was indeed the case.
We solved it.

0

Please sign in to leave a comment.