2015-09-15 186 views
2

我们已将TFS构建机器配置为从TFS构建源代码。在这台机器上,我们安装了Team Foundation Server 2013以及安装了Microsoft Build Tools 2013,然后最近安装了Microsoft Build Tools 2015.在构建定义中,我们为MSBuild参数添加了/tv:14.0,以表明我们希望使用版本14.0 MSBuild的。此外,我们将执行代码分析设置为false,以便不执行代码分析。 然而,当我们排队构建,它给出错误的失败:使用TFS 2013构建Visual Studio C++解决方案2015失败团队构建

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (214): The source file for this compilation can be found at: "C:\Users\tfsservice\AppData\Local\Temp\b54ca1bb-e696-4214-a196-5c79c32345cd.txt" 
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (214): An error has occurred during compilation. error CS1705: Assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (214): The "SetEnvironmentVariable" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin\amd64" directory. 

有谁以前遇到此问题? 它看起来像Microsoft.Build.Utilities.Core被引用到不正确的版本的Microsoft.Build.Framework。

然而,在MSBuild.exe.config,这个组件被corectlly重定向

<dependentAssembly> 
    <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> 
    <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="14.0.0.0"/> 
</dependentAssembly> 

任何帮助赞赏。

P.s.我们想要构建的解决方案是从VS 2013升级到VS 2015的visual C++解决方案。

回答

3

似乎许多其他社区成员都有类似问题,/tv:14.0参数不起作用。详细信息请查看link

解决方法是:而不是使用/tv:14.0的说法,你需要定制TFS生成过程模板来设置运行的MSBuild的刀具路径工程为目标,以MSBuild14;并将ToolVersion设置为“14.0”。

enter image description here

+0

感谢您的建议。我正在寻找不涉及更改流程模板的解决方案,因为它可能会导致在源代码管理中维护不同的构建模板。 – LxL

相关问题