【发布时间】:2015-09-19 17:40:12
【问题描述】:
我有一个在 BuildAgent 上运行的持续集成构建,但我无法正常工作。我最近将我们的代码库更改为 C# 6.0,并将项目更改为 ToolsVersion 14。
我确实在 Build Server (TFS 2012) 上安装了 Visual Studio 2015。如果我现在签入 C# 6.0 代码,则在第一个项目上构建失败(“$”是意外的或其他东西“)
BuildTemplate 是“DefaultTemplate.11.1” 如果我检查日志文件,构建会调用错误的 csc.exe (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe)
如果我确实使用项目启动 MSBuild/14.0/Bin/MSBuild 可执行文件而没有任何开关,则构建成功。为什么 TFS BuildAgent 不使用 ToolsVersion 以及如何让 TFS 2012 构建我的 Visual Studio 2015 解决方案
如果我添加 MSBuildArgument /tv:14.0 它仍然失败。因为它调用了 MSBuild 版本 12,它是 Visual Studio 2015 附带的 .NET 4.6 RC 框架的一部分。
更改 MSBuild Activity 的 ToolsPath 确实可以使 Build 正常工作,但如果我尝试运行我的 UnitTest,则会出现问题。我得到一个缺少的 dll“Microsoft.VisualStudio.TestPlatform.Utilities.dll”异常。 (VS2012 也安装在 Build Server 上)。
更新: 现在我的单元测试确实出现了一个不同的错误:
TF900548: An error occurred publishing the Visual Studio test results.
Details: 'Method not found:
'System.Collections.Generic.IEnumerable<System.String>
Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingsHelper.MergeRunSettingsAndFindCompatibleSources(Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
ByRef,
Microsoft.VisualStudio.TestPlatform.ObjectModel.FrameworkVersion
ByRef, System.String, System.String,
System.Collections.Generic.IDictionary`2<System.String,System.Collections.Generic.KeyValuePair`2<Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture,Microsoft.VisualStudio.TestPlatform.ObjectModel.FrameworkVersion>>,
System.Xml.XPath.IXPathNavigable, System.String ByRef)'.'
【问题讨论】: