问题描述
我最近才开始在我的项目中使用 C# 6.0 的 nameof()
运算符.现在(签入时,呃...)我(或者更好的是:构建代理)拒绝构建项目(在本地编译得很好),因为它找不到 nameof()
表达.
I just recently began using the nameof()
operator of C# 6.0 in my projects. Now (upon check-in, duh...) I (or better: the build agent) refused to build the project (which was compiling locally just fine) because it could not find the nameof()
expression.
我开始在构建控制器以及 TFS 服务器本身上安装 VS 2015,但无济于事.如何让我的 TFS 2013 Update 5 构建具有 C# 6.0 功能的项目?
I began installing VS 2015 on the build controller as well as the TFS server itself, but to no avail. How can I get my TFS 2013 Update 5 to build projects with C# 6.0 features?
我已经考虑过编辑 BuildProcessTemplate,但我们在所有构建定义中一直使用默认模板,我什至不知道这是否是正确的方法.
I already thought of editing the BuildProcessTemplate, but we're using the default template all the way through all our build definitions and I even didn't know if this was the right way to go.
推荐答案
您可以安装 "Microsoft Build Tools 2015" 在构建代理计算机上并配置构建模板以使用该版本的 msbuild,或者在您要使用新版本构建的项目中安装 Microsoft.Net.Compilers NuGet 包编译器.
You can either install the "Microsoft Build Tools 2015" on the build agent machine and configure the build template to use that version of msbuild, or else install the Microsoft.Net.Compilers NuGet package in the projects you want to build with the new compiler.
这篇关于使用 C# 6.0 功能运行 TFS 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!