11
votes

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.

1

1 Answers

21
votes

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.