简体   繁体   English

TFS构建无法找到某些NuGet软件包版本

[英]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.

相关问题 还原 NuGet 包时在 TFS Build 2015 期间“无法找到版本” - "Unable to find version" during TFS Build 2015 when restoring NuGet packages NuGet安装软件包错误(无法找到兼容的版本) - NuGet install-package error (unable to find version that is compatible) 项目 PROJECT 的 NuGet 包还原失败:无法找到包“Microsoft.Net.Compilers”的 2.0.0 版 - NuGet Package restore failed for project PROJECT: Unable to find version 2.0.0 of package 'Microsoft.Net.Compilers' tfs构建将找不到配置部分 - tfs build will not find the configuration section 从TFS中提取项目时,无法解决nuget包问题 - Unable to resolve nuget packages issue while pulling the project from TFS 找不到软件包“ angularjs” - Unable to find package 'angularjs' Nuget Package Manager控制台无法执行EntityFramework PowerShell脚本 - Nuget Package Manager console unable to execute entityFramework powershell scripts 如何在控制台找到已安装的 nuget 包? - How do I find an installed nuget package at the console? 配置TFS2015构建以了解我的自定义nuget存储库位置 - Configure TFS2015 build to understand my custom nuget repository location 在VS2015中安装NuGet包时出现TFS204018错误 - TFS204018 error when installing NuGet Package in VS2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM