Con*_*ole 33 msbuild tfs tfs2012
我在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 Framework的一部分.
如果我尝试运行我的UnitTest,更改MSBuild Activity的ToolsPath确实可以使Build工作但是吐出子弹.我得到了一个Missing 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)'.'
Run Code Online (Sandbox Code Playgroud)
Sim*_*ver 42
对于我们这些不是每天生活在构建模板中的人来说,这里的步骤是让它为我工作的:
首先找到与您的构建相关联的模板(如果您已经知道在哪里找到它,请跳过几个步骤).
只需右键单击构建定义并选择 Edit build definition
选择Process选项卡,您将看到模板的名称(如果您没有自定义,很可能是DefaultTemplate).在最右侧单击Show details以查看模板的路径.
HomeTeam explorer下的选项卡,然后单击Source control explorerRun MSBuild for Project单击右侧的小图标 - 不要尝试键入它,因为它可能会爆炸并导致Visual Studio崩溃.
输入IN QUOTES以下内容 "C:\Program Files (x86)\MSBuild\14.0\bin"
对我来说 Run MSBuild for Project是在两个地方.
所以我只是在两个地方重复上述步骤,然后在我检查.xaml文件后,我的构建最终工作正常.
您可能需要从TFS工具中回收代理/控制器.
Siv*_*lla 13
编辑模板将msbuild活动ToolPath更改为"MSBuild/14.0/Bin/MSBuild"
| 归档时间: |
|
| 查看次数: |
10535 次 |
| 最近记录: |