[英]TFS build unable to find some NuGet package versions
The packages restore fine on the developer PC and using Visual Studio on the build server. 这些软件包可以在开发人员PC上还原,也可以在构建服务器上使用Visual Studio还原。 When performing an automated build using TFS, however, many of the packages fail with a messages like these:
但是,当使用TFS执行自动构建时,许多软件包会失败,并显示以下消息:
WARNING: Unable to find version '5.0.4' of package 'Newtonsoft.Json'.
WARNING: Unable to find version '1.2.2' of package 'Microsoft.Net.Compilers'.
Other packages work fine: 其他软件包工作正常:
Added package 'WebGrease.1.5.2' to folder 'E:\d\w\50\s\NHXS.Web.RemittanceManager\packages'
I tried using -verbosity detailed
to get more information, but it didn't help. 我尝试使用
-verbosity detailed
来获取更多信息,但这没有帮助。 I know some people have had success by updating the NuGet config to use version 3 of the NuGet API, but given that some of the packages work - it seems like this wouldn't be the issue. 我知道有人通过更新NuGet配置以使用NuGet API的版本3取得了成功,但是鉴于某些软件包可以工作-看来这不是问题。 (And I don't want to break a production build server for other users).
(而且我不想为其他用户破坏生产构建服务器)。 Is there a way to get more information on the failures?
有没有办法获取有关故障的更多信息?
Possible duplicate with this question: "Unable to find version" during TFS Build 2015 when restoring NuGet packages 可能重复出现以下问题: 还原NuGet软件包时,在TFS Build 2015期间出现“无法找到版本”
Please check your nuget install task in your tfs build definition. 请在您的tfs构建定义中检查您的nuget安装任务。 If you already use V3.0 and the config file are still point to V2.0.
如果您已经使用V3.0,则配置文件仍指向V2.0。 You will get this error.
您将收到此错误。
Moreover, since the packages can be restored successfully on you dev PC, you can also compare the nuget.config file on your TFS server and dev PCs to see if there is any difference between them. 此外,由于可以在您的开发PC上成功还原软件包,因此您还可以比较TFS服务器和开发PC上的nuget.config文件,以查看它们之间是否有任何区别。 The nuget.config file locates at
"%APPDATA%\\NuGet\\NuGet.Config"
. nuget.config文件位于
"%APPDATA%\\NuGet\\NuGet.Config"
。
This helped me out but I chose to go a different route. 这帮助了我,但我选择了另一条路。
I didn't want to mess with the Nuget.config on our TFS server. 我不想弄乱我们TFS服务器上的Nuget.config。 Instead I checked in a more recent version of the nuget.exe command line in the solution and adjusted the path to the local copy.
相反,我在解决方案中签入了较新版本的nuget.exe命令行,并调整了本地副本的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.