TeamCity Nuget install build step not working with multiple sources, one of them TC's private NuGet feed

谁说胖子不能爱 提交于 2019-12-03 06:23:48

You can specify custom feeds just for solution via nuget.config file.

The key point is to provide credentials section packageSourceCredentials like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="Local" value="http://localhost:9090/httpAuth/app/nuget/v1/FeedService.svc" />
  </packageSources>
  <activePackageSource>
    <add key="Local" value="http://localhost:9090/httpAuth/app/nuget/v1/FeedService.svc" />
  </activePackageSource>
  <packageSourceCredentials>
    <Local>
      <Username>login</Username>
      <Password>pa$$w0rd</Password>
    </Local>
  </packageSourceCredentials>
</configuration>

This config file should be next to the sln file in repository.

This appears to be a known issue for TeamCity. The workaround suggests adding the package source via the command line client and then updating those sources with the authorization credentials:

nuget sources add -name [name] -source [feedUrl]
nuget sources update -Name [name] -User [username] -pass [password]

It's my understanding that Nuget will cache those credentials for future requests. I don't know how often that cache is cleared; you may need to run that nget sources update right before you kick off your build to ensure that the cache is coherent.

We implemented authenticated feed support in TeamCity plugin. Please follow comments to the issue http://youtrack.jetbrains.com/issue/TW-20764

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!