TFS无法恢复nuget包(dev PC build ok)

时间:2016-03-16 22:28:25

标签: tfs tfsbuild

以前使用的内部部署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包可以毫无问题地恢复。

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

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

您使用的nuget.exe版本也可能导致此问题,请参阅此问题以供参考:"Unable to find version" during TFS Build 2015 when restoring NuGet packages