Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running TFS Build with C# 6.0 features

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.

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?

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.

like image 231
SeToY Avatar asked Jul 24 '15 02:07

SeToY


People also ask

Can we use TFS for CI CD?

TFS can be used with numerous IDE including Visual Studio and Eclipse on all platforms. It also provides the features of implementing both CI and CD. It has the feature of Build Management which includes build process management and automating build triggering.

How do I publish a TFS code?

Import the Publishing Profile In Visual Studio, open your Web Project. Right click the Web Project node from Solution Explorer and choose Publish. On the Profile tab of the Publish Web dialog, click Import to import the publish settings file. Test that you are able to deploy from Visual Studio.


1 Answers

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.

like image 97
Kevin Pilch Avatar answered Sep 30 '22 03:09

Kevin Pilch