I have a simple test console app. The only code it has is
public class Class1
{
private protected int _value = 0b_1001_0110;
}
which is just to test whether these C# 7.2 features will build or not.
In Visual Studio 2017 15.5.2 they build fine if I set the language version like this
If I now check the project into VSTS and run a build it fails with various errors, e.g.
Test\CSharp72Test\CSharp72Test\Class1.cs(7,17): Error CS0107: More than one protection modifier
Test\CSharp72Test\CSharp72Test\Class1.cs(7,40): Error CS1013: Invalid number
because it knows nothing about C#7.
If I now add 'Microsoft.NET.Compilers 2.6.1' NuGet package and rebuild it works fine locally but fails in VSTS with
Test\CSharp72Test\CSharp72Test\Class1.cs(7,40): Error CS8107: Feature 'leading digit separator' is not available in C# 7.0. Please use language version 7.2 or greater.
It's now using the correct version of CSC.exe but not passing /langversion:latest.
How do I get this passed correctly per project in a multi project solution?