23
votes

I have just created a new VM on Azure (using the image provided by the Azure team from the gallery) with CTP version of the upcoming Visual Studio 2014 that appeared yesterday online to test it and especially to play around with new C# 6.0 features.

However, it does not provide support for C# 6.0 out of the box, for none of the language extensions (primary constructors, property initializers, safe navigation operator) work there.

A blog entry on MSDN suggests adding the following to project settings:

 <LangVersion>Experimental</LangVersion>

But this changes nothing in my console project. Even the sample code from the second link doesn't compile at all.

safe navigation operator is not recognized

Do I miss something?

1
Do you have Roslyn installed?abatishchev
Do I need to install it separately? It should be now an integral part of Visual Studio and I see some new features leveraged by it (like refactorings).Alexander Galkin
@RobertLevy I typed the code as it is, the space was added by the editor automatically without asking me, so I just left it as it is to show that the actual intent wasn't clear both to compiler and editor.Alexander Galkin
@BradChristie Actually I just used the image provided by Azure to create a brand new VM with only VS2014CTP installed there, there is no any other side-by-side software whatsoever and it is running in the VM hosted on Azure. I will edit my question to add this detail, if this might be important here.Alexander Galkin
Try using "experimental" with a lower case 'e'. We had a bug where we compared case sensitively, and may not have got the fix checked in early enough to reach the CTP.Kevin Pilch

1 Answers

26
votes

There is a bug in the CTP where the LangVersion switch is case sensitive. Try using experimental instead.