tfsbuild - Visual Studio Online CI daily builds fail since switching to VS 2015 and using C# 6 Roslyn features -


since switching vs 2013 vs 2015 , using new c# 6 features, our daily builds in visual studio online have begun failing.

the errors on build pointing new auto property feature assume new features cause this.

an example piece of code causes failure using:

public int myfavouritenumber { get; set; } = 7; 

instead of

private int _myfavouritenumber = 7; public int myfavouritenumber      {          { return _myfavouritenumber; }          set { _myfavouritenumber = value; }      } 

i've had around build configuration, can't see relates c# 6 or roslyn.

what have change make daily builds work again?

edit

here's example error (they're same, auto properties).

models\core\bookings\bookingproduct.cs (29, 0) invalid token '=' in class, struct, or interface member declaration

models\core\bookings\bookingproduct.cs (29, 0) invalid token '(' in class, struct, or interface member declaration

and here offending line:

public virtual ilist<bookingpricingaddon> addonspricing { get; set; } = new list<bookingpricingaddon>(); 

thelethalcoder's comments pointed me in right direction.

the problem of projects using default target language version, fine if you're using vs 2015, however, .sln file had following opening 3 lines:

microsoft visual studio solution file, format version 12.00 # visual studio 2013 visualstudioversion = 12.0.31101.0 

apparently, visual studio online uses work out version of msbuild use. (it using 12).

upgrading solution following:

microsoft visual studio solution file, format version 12.00 # visual studio 14 visualstudioversion = 14.0.23107.0 

allowed visual studio online see ide using roslyn, , therefore used msbuild 14.

the easiest way found upgrade click on solution in solution explorer , going file > save > solution file , overwrite existing solution file, upgrades first 3 lines.

my builds successful.

i think same achieved setting language version on each of projects. can done going .csproj files , navigating to:

properties > build > advanced > language version > c# 6.0 

a reference default settings in each ide can found here.

default compilers each ide.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -