Does Visual Studio 2015 Nuget v1 support feeds

I have a V1 Nuget token from Team City.

I have installed VS 2015.

I am trying to install and an existing package and I am getting the following error in search packages

invalid NuGet v2 service response

Does VS2015 support V1 channels? or is there a config I can change.

+3


source to share


1 answer


I have a similar problem with a TeamCity nuget feed.

To answer your first question, yes, I believe VS2015 still supports Nuget API V1.

Here's what I think I know so far:

  • TeamCity can use either v1 or v2 of the Nuget API.
  • FindPackagesById is implemented in Nuget API v2, not v1 (you can force TeamCity to use v2 by adding a line teamcity.nuget.api.version=v2

    to a file internal.properties

    in the TeamCity data directory.
  • To see which version you are using, you can view the endpoint $metadata

    on your server (for example, http://mybuildmachine.com/httpAuth/app/nuget/v1/FeedService.svc/ $ metadata). The presence of the method FindPackagesById

    will show that you are using v2. The version number in the URL does not change. Yes, it is confusing.
  • TeamCity returns 204 No Content

    when FindPackagesById

    not returning packages. Nuget.org returns no results, but wrapped in an XML document.


Source below in ASP.NET source where things go wrong. If the XML document from the response cannot be parsed, it just crashes and dies.

https://github.com/aspnet/dnx/blob/37575f3197c0b65d42e3a1db240d636aeab5a1e6/src/Microsoft.Framework.PackageManager/Restore/NuGet/NuGetv2Feed.cs#L230

I couldn't find a copy of the Nuget spec to determine what counts as a valid answer for FindPackagesById

, but if the answer 204

is in violation of the spec, it might be a TeamCity bug.

My current workaround when using multiple package sources is to simply temporarily disable irrelevant sources when installing certain packages.

+4


source







All Articles