TFS构建失败,但是Visual Studio可以工作 [英] TFS build fails, but Visual Studio works

查看:95
本文介绍了TFS构建失败,但是Visual Studio可以工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经定义了一个新的版本.大多数选项保持默认状态.我现在只是在玩耍.

I have made a new build definition. Most options are kept on default. I'm just playing around for the moment.

问题是,当我在Visual Studio 2013中以发布模式构建项目时,一切都很好,而不是错误.在构建TFS时,我会遇到一些错误:

Problem is that when I build my projects as release mode in Visual Studio 2013 all is good, not errors. When TFS builds it I have a few errors:

(我必须将其从自己的语言翻译成英语,对此感到抱歉)

(I had to translate it from my own language to English, sorry for that)

TemplateService.cs (80): Core.Infrastructure.Objects.PredefinedTemplate does not contain a definition for TemplateId and there is no extentionmethod TemplateId found gevonden *(something with first argument)* of the type Infrastructure.Objects.PredefinedTemplate is being accepted (possibly missing a user instruction or an assmbly-reference)

我已经做过的事情:

  • 如某些网站上所述,将引用的DLL的本地副本再次设置为false和true.
  • 检查构建定义是否清理工作空间(确实如此)
  • 将程序集名称添加到代码中的对象. IE.: 从PredifinedTemplate到Core.Infrastructure.Objects.PredefinedTemplate
  • Set the copy local of the referenced DLLs to false and true again, as stated on some websites
  • Check the build definition if it cleans the workspace (it does)
  • Added assembly names to the objects in code. I.e.: PredifinedTemplate to Core.Infrastructure.Objects.PredefinedTemplate

无论我做什么,我都会不断遇到这些错误!有人知道发生了什么吗?

Whatever I do, I keep gettings these errors! Does anyone know what is happening?

更新:

如James Reed所述,我已将引用的项目放在NuGet包中.最后,我不得不在NuGet-packages中放置两个项目.现在可以在TFS上进行构建,甚至可以部署到服务器上.

As stated by James Reed I have placed the referenced projects in NuGet packages. In the end I had to place two projects in NuGet-packages. The build on TFS works now and it even deploys to the server.

由于调试功能,使用NuGet不是我的首选.但是对于这两个仅包含对象和数据实体的项目,这应该不是问题.

Using NuGet is not my first choice, because of debugging functionality. But for these two projects, that only holds objects and data-entities, it should not be a problem.

推荐答案

您缺少程序集引用.即包含TemplateId定义的dll在构建服务器上不可用.

You are missing an assembly reference. i.e. the dll containing the definition for TemplateId is not available on the build server.

如果在同一解决方案的项目中定义了此项目,则项目引用有问题,请尝试删除并重新创建引用.

If this is defined in a project in the same solution, then something is wrong with the project reference, try deleting and recreating the reference.

如果这是二进制引用,那么您有3个选择

If this is a binary reference then you have 3 options

  1. 将项目添加到解决方案中,并使用项目参考.
  2. 将二进制文件签入到源代码管理中(不推荐)
  3. 使用nuget管理您的引用

这篇关于TFS构建失败,但是Visual Studio可以工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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