11

Is there a way to use the Roslyn compiler with Visual Studio 2013 so that I can take advantage of the new C# 6 features ?

Note: Using VS 2015 is not an option.

Sheng Fang
  • 21
  • 3
Ayman
  • 1,387
  • 4
  • 20
  • 35

1 Answers1

21

Yes, you can compile C# 6 code with Visual Studio 2013. You just have to install the Microsoft.Net.Compilers NuGet package and your code will build just fine (however, note that you need to target .NET 4.5+).

But, the IDE won't understand it. You'll get squiggles everywhere you try to use a C# 6 feature, because VS2013's internal "live" compiler is not the same. Working in such an environment on a daily basis will drive you insane in less than two weeks.

That said, if all you need is compiling C# 6 code, installing the NuGet package on VS2013 is a potential solution.

Patrice Gahide
  • 3,644
  • 1
  • 27
  • 37