TFS 无法还原 NuGet 包 [英] TFS Can't Restore NuGet Package

查看:32
本文介绍了TFS 无法还原 NuGet 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我让 TFS 进行了一些持续集成构建.今天,它打破了一种解决方案.似乎找不到 AutoMapper.所有其他的包都可以找到就好了.

I've got TFS doing some continuous integration builds. Today, it broke for one solution. It seems it can't find AutoMapper. All the other packages can be found just fine.

几个相关点:

  • 没有一个包在源代码管理中,我们让 TFS 恢复它们.
  • 我们有一个内部 NuGet 提要,但在其他解决方案中这似乎不是问题,在这个解决方案中,我们仍然需要恢复实体框架 - 只是不是 AutoMapper.
  • 我尝试删除并重新添加 NuGet 包.不走运.
  • 如果我使用远程桌面连接到构建服务器并在那里在 Visual Studio 中打开项目,它会恢复包并正常构建.
  • 我可以通过执行 D:"Program Files""Microsoft Team Foundation Server 12.0"ToolsNuget.exe restore 后跟 msbuild MySolutoin.sln
  • 我们的 TFS 服务器安装在 D: 驱动器上.

这是来自 TFS 日志:

This is from the TFS Logs:

D:Program FilesMicrosoft Team Foundation Server 12.0Tools
uget.exe restore "C:Builds1MyCompany WebFclQuoteWcfServicesrcFclQuoteWcfService.sln" -NonInteractive
Installing 'EntityFramework 6.1.3'.
Installing 'InternalPackage 1.0'.
Successfully installed 'InternalPackage 1.0'.
Successfully installed 'EntityFramework 6.1.3'.
Unable to find version '3.3.1' of package 'AutoMapper'.
C:Program Files (x86)MSBuild12.0inamd64MSBuild.exe /nologo /noconsolelogger "C:Builds1MyCompany WebFclQuoteWcfServicesrcFclQuoteWcfService.sln" /nr:False /fl /flp:"logfile=C:Builds1MyCompany WebFclQuoteWcfServicesrcFclQuoteWcfService.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /m /p:OutDir="C:Builds1MyCompany WebFclQuoteWcfServicein\" /p:VCBuildOverride="C:Builds1MyCompany WebFclQuoteWcfServicesrcFclQuoteWcfService.sln.vsprops" /dl:WorkflowCentralLogger,"D:Program FilesMicrosoft Team Foundation Server 12.0ToolsMicrosoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/230;IgnoreDuplicateProjects=False;InformationNodeId=12;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://ctidev2k8:8080/tfs/MyCompany;"*WorkflowForwardingLogger,"D:Program FilesMicrosoft Team Foundation Server 12.0ToolsMicrosoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="9aa9f8af-c9b9-4d0a-ba06-7cc959231d8e,vstfs:///Build/Build/230" /p:BuildLabel="FclQuoteWcfService_20150330.2" /p:BuildTimestamp="Mon, 30 Mar 2015 20:40:07 GMT" /p:BuildSourceVersion="LFclQuoteWcfService_20150330.2@$/MyCompany Web" /p:BuildDefinition="FclQuoteWcfService"
 Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

推荐答案

我也见过这个.一旦 NuGet 包还原切换到内部提要,它似乎就会被触发.一旦完成,就不会切换回官方的 nuget.org 提要,而是继续在内部提要中查找包.

I've seen this too. It seems to be triggered as soon as NuGet package restore switches to the internal feed. Once it does this is doesn't switch back to the official nuget.org feed and continues to look for the packages on the internal feed.

确保将两个包源都添加到您的 NuGet.config 文件中.还要确保两个来源都是活动的".

Ensure both package sources are added to your NuGet.config file. Also ensure both sources are 'active'.

<configuration>
    <packageSources>
        <add key="nuget.org"
             value="https://www.nuget.org/api/v2/" />
        <add key="example.com"
             value="http://example.com/feed/nuget/" />
    </packageSources>
    <activePackageSource>
        <add key="All"
             value="(Aggregate source)" />
    </activePackageSource>
</configuration>

请参阅 NuGet 配置文件 文档.

这篇关于TFS 无法还原 NuGet 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆