I have setup a NuGet Package feed in TFS 2017 Update 1. The NuGet Source is as following
http://tfsserver:8080/tfs/defaultcollection/_packaging/NuGet-Feed/nuget/v3/index.json
Following the instructions stated when connecting to TFS Package Feed, I added NuGet source locally and also try to publish package(s) to the NuGet Feed with following format as an example:
nuget.exe push -Source "NuGet-Feed" -ApiKey INCTX Microsoft.AspNetCore.Http.Abstractions.1.1.2.nupkg
The result of executing above command is as following:
Pushing Microsoft.AspNetCore.Http.Abstractions.1.1.2.nupkg to 'http://tfsserver:8080/tfs/DefaultCollection/_packaging/23093bd8-41aa-403d-9d3f-5c713b14ce32/nug
et/v2/'...
PUT http://mtrlpqdc2av-053:8080/tfs/DefaultCollection/_packaging/23093bd8-41aa-403d-9d3f-5c713b14ce32/nuget/v2/
Accepted http://mtrlpqdc2av-053:8080/tfs/DefaultCollection/_packaging/23093bd8-41aa-403d-9d3f-5c713b14ce32/nuget/v2/ 1702ms
Your package was pushed.
As it shows, the package is published to 'nuget/v2' endpoint.
Running TFS Build with NuGet Restore task: the following command expects nuget/V3/ endpoint from the TFS Feed which does not exists. Note: NuGet restore task in TFS build is customized to use NuGet 4.. version.
The question I guess is why NuGet Push will publish to 'nuget/v2/' endpoint.
TFS Build NuGet Restore Task output:
2017-07-06T15:58:13.0657118Z CredentialProvider.TeamBuild: URI: http://tfsserver:8080/tfs/defaultcollection/_packaging/INCTX-NuGet-Feed/nuget/v3/index.json
2017-07-06T15:58:13.0657118Z CredentialProvider.TeamBuild: Is retry: False
2017-07-06T15:58:13.0657118Z CredentialProvider.TeamBuild: Matched prefix:
2017-07-06T15:58:13.2688422Z CredentialProvider.TeamBuild: This provider only handles URIs from the build's Team Project Collection
2017-07-06T15:58:13.6125991Z GET tfsserver:8080/tfs/DefaultCollection/_packaging/23093bd8-41aa-403d-9d3f-5c713b14ce32/nuget/v3/flat2/microsoft.netcore.app/index.json
2017-07-06T15:58:13.6125991Z GET tfsserver:8080/tfs/DefaultCollection/_packaging/23093bd8-41aa-403d-9d3f-5c713b14ce32/nuget/v3/flat2/microsoft.netcore.app/index.json
2017-07-06T15:58:13.7219799Z NotFound
Thanks,
Mamrez