2015-09-15 232 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

相關問題