【问题标题】:TFS unable to restore nuget packages (dev PCs build ok)TFS 无法恢复 nuget 包(开发 PC 构建正常)
【发布时间】:2016-03-18 15:16:00
【问题描述】:

以前工作的本地 TFS 2015(带有更新 1)会使所有包含 nuget 包的构建失败。构建日志显示:

MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
Restoring NuGet package StyleCop.Error.MSBuild.1.0.0.
Restoring NuGet package Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28.
Restoring NuGet package Microsoft.Diagnostics.Tracing.EventRegister.1.1.28.
Restoring NuGet package Microsoft.Diagnostics.Tracing.EventSource.1.1.28.
Restoring NuGet package StyleCop.MSBuild.4.7.50.
Restoring NuGet package Newtonsoft.Json.8.0.3.
Restoring NuGet package Dapper.1.42.0.
Restoring NuGet package FluentAssertions.4.2.2.
WARNUNG: Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventRegister'.
WARNUNG: Unable to find version '1.0.0' of package 'StyleCop.Error.MSBuild'.
WARNUNG: Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventSource.Redist'.
WARNUNG: Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventSource'.
WARNUNG: Unable to find version '1.42.0' of package 'Dapper'.
WARNUNG: Unable to find version '8.0.3' of package 'Newtonsoft.Json'.
WARNUNG: Unable to find version '4.7.50' of package 'StyleCop.MSBuild'.
WARNUNG: Unable to find version '4.2.2' of package 'FluentAssertions'.
Unable to find version '4.2.2' of package 'FluentAssertions'.
Unable to find version '4.7.50' of package 'StyleCop.MSBuild'.
Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventRegister'.
Unable to find version '8.0.3' of package 'Newtonsoft.Json'.
Unable to find version '1.42.0' of package 'Dapper'.
Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventSource'.
Unable to find version '1.1.28' of package 'Microsoft.Diagnostics.Tracing.EventSource.Redist'.
Unable to find version '1.0.0' of package 'StyleCop.Error.MSBuild'.
Unerwarteter Exitcode 1 vom Tool NuGet.exe zurückgegeben

在开发 PC 上,解决方案构建得很好,并且 nuget 包可以毫无问题地恢复。

如何解决这个问题?

【问题讨论】:

  • 您使用的是哪个构建系统,vNext 还是 XAML?你能分享整个日志吗?并检查是否有人将包添加到源代码管理中。如果是,请删除 packages 文件夹,然后重试。
  • 我们使用 TFS 中的默认构建系统。 nuget 包肯定不会在 git 存储库中提交。

标签: tfs tfsbuild


【解决方案1】:

错误消息表明在您的包资源中找不到包。由于包可以在您的开发 PC 上恢复,您可以比较您的 TFS 服务器和开发 PC 上的 nuget.config 文件,看看它们之间是否有任何区别。 nuget.config 文件位于“%APPDATA%\NuGet\NuGet.Config”。

而且你使用的nuget.exe版本也可能导致这个问题,参考这个问题:"Unable to find version" during TFS Build 2015 when restoring NuGet packages

【讨论】:

    猜你喜欢
    • 2016-07-11
    • 1970-01-01
    • 2015-04-26
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    • 2021-07-04
    • 2018-06-26
    • 2014-06-30
    相关资源
    最近更新 更多