Does Visual Studio 2015 Nuget v1 support feeds
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 fileinternal.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 methodFindPackagesById
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
whenFindPackagesById
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.
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 to share