binard
binard

Reputation: 1784

TFS 2017 share nuget packages with other team collection

In my TFS 2017, I have two team projects collection. The first collection generate nuget packages in its collection nuget feed. I would can restore this packages from a project's build that is in the second team project collection. Is it possible and how ?

When I restore I have a 401 error and I don't see how to add permissions to restore from other collection projects.

Upvotes: 0

Views: 264

Answers (2)

Rimi
Rimi

Reputation: 81

I had the same issue, though the error was not 401, but "error NU1301: Unable to load the service index for source https://.../nuget/v3/index.json". (a package from another collection in TFS). I solved it by changing Pipeline in TFS. In section Restore i had task version 1 (DotNetCoreCLI@1). I changed it to version 2 (DotNetCoreCLI@2). Everything has been successfully restored.

Upvotes: 0

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31003

Yes, it is possible. Adding the feed in Nuget.config file like the sample below in the second project and specify the Nuget.config path in your build definition

<packageSources>
    <add key="TFSFeed" value="http://tfssetver:8080/tfs/teamprojectCollection/_packaging/TFSFeed/nuget/v3/index.json" />
</packageSources>

Make sure you are running the build agent under the account that can access the feed.

Upvotes: 1

Related Questions