【发布时间】:2017-07-09 23:56:25
【问题描述】:
TFS2013 update 5,VS2015 Enterprise update 3 在 dev PC 和 构建服务器 上(根据 What is required for doing Unit Tests on a Build Server?)。
Project 是一个标准的 MVC5 框架,目前几乎没有进行任何修改。该项目可以编译,但有两个主要问题。
第一期:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1697): Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
接下来是针对<runtime> 节点的一系列建议的 xml 编辑,如下所示:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
其他 3 条建议在此不再赘述,因为它们基本相同。它们分别寻址Microsoft.Owin、WebGrease 和Newtonsoft.Json。但这令人困惑,因为当我检查 web.config 中的 <runtime> 节点时,警告消息中推荐的精确 xml 元素已经在 web.config 中用于所有 4 个项目。另外,警告说双击或选择它,但我不能这样做。
第二期:
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow'.
我在构建服务器上检查了指定的位置,果然请求的文件夹树不存在,树停在(x86)\Microsoft Visual Studio 12.0\Common7\IDE\。我在(x86)\Microsoft Visual Studio 14.0 和(x86)\Microsoft Visual Studio 14.0\Common7\IDE\\CommonExtensions\Microsoft\TestWindow 下检查了存在,并且整个位置都存在重要的安装。
我还查看了VS2015 build with TFS2013,它建议了一个特定的 MSBuild 参数。鉴于上述路径问题,这似乎是有道理的,但在我尝试之前,我想确认它对我的一组问题是有意义的,并且特定参数是否正确。另外,那个 MSBuild 参数会解决第一期提到的冲突吗?
最后,在研究这一切的过程中,我开始看到构建服务器配置的规模有多大。这有点吓人。如果我可以开始学习参考资料或书籍,我将不胜感激,以便为这个过程接受更好的教育。
更新:在 TFS 2013 building .NET 4.6 / C# 6.0 中的简单 MSBuild 参数 /tv:14.0 之后,第一个问题得到了解决。构建现在可以找到正确的程序集。
仍在寻求解决有关 Test Runner 的第二个问题,但我正在阅读的一些帖子表明这种特殊的 VS/TFS 组合是不寻常的。可能是在构建服务器上同时需要 VS2015 和 VS2013,而测试需要 VS2013。会回来报告的。
【问题讨论】:
标签: visual-studio-2015 msbuild continuous-integration build-server