除了我,.NET Project为每个人构建

时间:2016-02-12 14:54:16

标签: .net build

所以这是一个奇怪的问题,我们都无法弄明白。

我们在TFS中有一个解决方案。我团队中的其他人都能够解决问题,并在没有任何问题的情况下构建解决方案。我正在使用相同的工作区,但是当我下载代码并构建解决方案时,它失败了,告诉我它找不到多个引用。

当我找到其中一个已识别的问题时(例如,找不到引用的类),Visual Studio会识别引用并按住ctrl + click将我带到构建所说的无法找到的类中。另外,如果我按照硬路径给出了构建输出中无法找到资源的信息,那么资源正是它无法找到的地方。

我已经多次吹走了工作区,我尝试在VS2013中打开解决方案,而不是像其他人一样在VS2015中打开解决方案,这也不起作用。我已经尝试删除项目中失败的引用,然后重新添加它们,这没有任何效果。

以前有人见过这样的事吗?

对我能尝试的其他事情有任何想法吗?

2 个答案:

答案 0 :(得分:0)

您是否在解决方案目录中看到了[您的解决方案名称]。 suo 文件?有时,.sln文件被锁定且无法更新 - 这意味着项目引用和类似设置无法正确加载。请尝试以下方法:

  1. 关闭VS
  2. 删除解决方案目录中的所有.suo文件
  3. 重新打开解决方案并尝试构建
  4. 过去,当我遇到无法理解的项目参考错误时,这对我来说是有用的,而这些错误并非由正常的"删除和重新添加"特技。祝你好运!

答案 1 :(得分:0)

Following Lex Li's advice, running with diagnostic logging on, I found that it was complaining about the targeted framework of a dependency of a primary dependency.

The odd thing to me is that the primary dependency (targeting .NET 3.5) built just fine. The project that was failing targets .NET 4.0 and was failing because of the dependency that built without a problem. This makes absolutely no sense to me.

To solve it though, I manually added a new version of the package it was complaining about, and it began building without any trouble. So I can't say what caused this, but manually dropping a different version of the dependency solved it.

EDIT:

The above solved it for a time, but then it stopped working inexplicably. A new member joined our team and had no problems with the build, but when he installed some of the updates VS was telling him to install, the build stopped working. It turns out that having "ASP.NET 5 RC1 Update 1" installed breaks our build, and prior to the new member updating his VS instance, nobody else on the team had the suggested updates installed.