3

I've tried installing the Roslyn end user preview to play around with some of the new C# 6.0 features, but I can't get it to work. I have Visual Studio Premium 2013 Update 3 installed. I've downloaded the Roslyn end user preview, and it installed without any problems. After restarting Visual Studio, I tried doing what has been suggested: create a new project to make it switch to the new compiler, then discard that project and open an existing project, or create another new project.

I've now tried to make a plain console project using the .NET 4.5 framework. However, I can't get any of the new C# 6.0 features to work. Neither auto-property initializers, declaration expressions, exception filters nor explicit constructors will compile for me. I've tried compiling identical code on a different computer without the Roslyn preview installed, and it gives me the same compilation errors, so it seems like it's still using the old compiler.

How can I make VS switch to using the Roslyn compiler instead?

Martin Wedvich
  • 2,158
  • 2
  • 21
  • 37
  • Just to make sure: you actually tried compiling the code, right? It's not just that you're seeing squiggles from R#? – svick Aug 19 '14 at 23:41
  • Yeah, I do get compiler errors. I tried compiling the exact same code on a different PC without the Roslyn preview, and I get the same errors, so it's definitely using the old compiler still. – Martin Wedvich Aug 20 '14 at 05:59
  • possible duplicate of [Enabling C# 6 in ASP.VNext projects in Visual Studio CTP2](http://stackoverflow.com/questions/25106044/enabling-c-sharp-6-in-asp-vnext-projects-in-visual-studio-ctp2) – Ian Ringrose Aug 21 '14 at 14:11
  • 1
    @IanRingrose I'm not using the Visual Studio 2014 CTP, and this is not an ASP.NET vNext project. I'm having a specific problem that the question this allegedly duplicates doesn't address, and neither of the answers to that question are relevant or helpful here. I'll edit my question to clarify that. – Martin Wedvich Aug 21 '14 at 14:44
  • The new features of CTP 3 (expression-bodied function members, nameof operator, Null-conditional statement expressions) still not worked for me either. – Alex Siepman Aug 22 '14 at 19:30
  • Can you run `rcsc.exe` from the command line, out of interest? – Jon Skeet Aug 22 '14 at 21:05
  • @AlexSiepman: did you mark your project as using experimental language features per http://stackoverflow.com/questions/24066584/no-c-sharp-6-0-in-visual-studio-2014-ctp? – Jason Malinowski Aug 26 '14 at 01:07
  • @JasonMalinowski That does work in VS2014 (not VS 2013). Thanks!! – Alex Siepman Aug 26 '14 at 07:20

0 Answers0