Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# 6.0 TFS Builds

I'm trialing the new features of C# 6.0 within Visual Studio 2015 CTP and my project is failing to build in TFS 2013 and Visual Studio Online.

I understand that Visual Studio uses the new Roslyn compiler, which replaces the native .NET one, and the TFS build agent therefore is unable to compile.

My question is how do I install Roslyn on the build agent (and within Visual Studio Online) and tell the build agent to use this compiler over native?

like image 941
Chris Pickford Avatar asked Feb 02 '15 22:02

Chris Pickford


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

What is C language?

C is an imperative procedural language supporting structured programming, lexical variable scope, and recursion, with a static type system. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support.


2 Answers

For the compilation step, you have a couple of options:

  1. You can reference the Microsoft.Net.Compilers NuGet package on a per-project basis to use that version of the compilers.
  2. You can install the Microsoft Build Tools package that is part of the VS 2015 CTP package without installing all of VS.

However, as @MrHinsh notes, these approaches may leave you missing other parts of your toolchain.

like image 192
Kevin Pilch Avatar answered Sep 20 '22 08:09

Kevin Pilch


If you create an Azure VM with Server 2012 r2 and install Visual Studio 2015 CTP and TFS 2013 Build you can connect it to VSO.

You should then be able to complete your build and it will automatically use the new compiler.

While you can just install the compilers there is more to building than just compiling. You will likely very quickly need other features of Visual Studio, like Unit Testing, to execute as part of your build. Your build agent should reflect your developer standard workstation. If your Devs need it then the agent likley needs it.

Note: Visual Studio is licensed to individuals and not by machine. There is no license needed to run it on a build agent. Indeed as long as you have a single licence registered to your or of a particular level, say Ultimate, then you can install that on every build server.

like image 45
MrHinsh - Martin Hinshelwood Avatar answered Sep 20 '22 08:09

MrHinsh - Martin Hinshelwood