TeamCity Build Server无法恢复nuget包

时间:2017-12-15 15:39:10

标签: tfs nuget teamcity

请记住,我是TeamCity平台的新手。 : - )

我们正在使用TeamCity来构建我们的项目,并遇到了一个问题,其中有几个项目需要nuget来恢复丢失的包。

问题的第一个线索就是错误,“这个项目引用了这台计算机上缺少的NuGet包。启用NuGet Package Restore来下载它们。”

我添加了一个构建步骤,并将其作为序列中的第一步,现在发生的是TeamCity检查3个位置以努力解析包。前两个位置是构建服务器的本地位置。

一个。的NuGet \缓存 B.包裹 C.尝试连接https://api.nuget.org/v3/index.json

它尝试还原的软件包在本地构建服务器上不存在,因此它尝试引用api.nuget.org存储库,该存储库在超时后出现错误,一直失败:

无法加载源https://api.nuget.org/v3/index.json的服务索引。 发送请求时发生错误。 无法连接到远程服务器 连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机无法响应10.80.127.254:80

我已经研究过这个错误,并且看到其他人报告了相同的问题,但未能找到任何明确的解决方案。

由于VS2017在适用项目解决方案中包含的软件包目录时从本地环境获取了缺少的程序集包。

因为当通过TFS执行签入时,会在构建服务器上复制(引用)文件夹和文件。

是否应该有某种方法指示TeamCity包含也检入的packages目录?

否则,当构建服务器上不存在packages目录且所有搜索位置都失败时,TeamCity想要执行包还原时还有哪些其他选择可以避免?

**我不相信这是一个重复的问题,但如果是的话,请将我推荐给相应的链接**

THX

1 个答案:

答案 0 :(得分:1)

Generally when the changes are checked in the solution/project files will be updated automatically. So the dependencies will also be updated, basically we just need to add the Nuget Resore step to restore the packages for the solution.

In you scenario, please check if you have set the proxy. If it is, then you need to add proxy settings into >>> [0] + [1 if i<j else 0 for i,j in zip(l, l[1:])] >>> [0, 1, 0, 0, 0, 1] file. Refer to this link for details: Nuget Config Section & Nuget Proxy Settings.

Alternatively you can download the needed packages from nuget to a shared directory then add to Nuget.Config as the source.

Reference:

Also check if this thread helps: Please enable auto "Enable auto assign public IP" in VPC settings.