4

I'm using a NuGet server 3.4.3 through TeamCity with the following URL

http://ngserv/guestAuth/app/nuget/v1/FeedService.svc/

Trying to access the pakcage source with Visual Studio 2015 Update 2 and getting this error:

[NGServ package source] The V2 feed at

http://ngserv/guestAuth/app/nuget/v1/FeedService.svc/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net35'&includePrerelease=false&$skip=0&$top=26

returned an unexpected status code '404 Not Found'.

Any ideas what is causing this?

Note: This works with Visual Studio 2015 Update 1, so maybe it's an Update 2 issue?

node_modules
  • 4,790
  • 6
  • 21
  • 37
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313

3 Answers3

3

This is a known issue with TeamCity and the latest NuGet Client. You can get this to work by updating the protocol in the TeamCity (teamcity.nuget.api.version=v2) and using FindPackagesById(). The v1 protocol is super inefficient and we recommend that you dont use it. For more details, check out the GitHub issues here.

In adddition, TeamCity is not actively developing this component anymore and we also recommend that you look into alternative hosting mechanisms that include NuGet.Server or VSTS package management. There are also a number of non-microsoft alternatives around pacakage repository management out there as well.

Update: Sorry, not a TeamCity expert. This integration was built by the TeamCity team and not us. The admin documentation here should give you an idea how to do it.

  • +1 for this. I will accept if you can provide me detailed instructions on HOW to update the TC protocol version (teamcity.nuget.api.version=v2) – Matthew Layton May 31 '16 at 13:08
  • We were facing the same problem and we had to create own NuGet.Server but it's very easy and it solved the problem. – user2250152 Jun 02 '16 at 07:36
3

As Harikrishna Menon A wrote, you need to set TeamCity internal property teamcity.nuget.api.version. Internal properties are stored in [TeamCity Data Directory]/config/internal.properties. File internal.properties is not present by default, create it if absent. Then write separate string in the file:

teamcity.nuget.api.version=v2

Then restart your TeamCity server. The URL of NuGet feed will not change, however protocol will. This actions helped me on TeamCity Professional 9.1.7.

Anton Sutarmin
  • 807
  • 8
  • 15
2

Another thing you may want to check is that the casing of your url is correct. Believe it or not, the package feed url is CASE SENSITIVE. I received the OPs error because I had

feedservice.svc instead of FeedService.svc.

Also note, that you will need to add the package source with a different name and then delete the old one as otherwise VS will helpfully retain the existing casing. Make sure that after you correct the casing you go back and verify it is still correct after saving.

Sam Shiles
  • 10,529
  • 9
  • 60
  • 72