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.
Roslyn, the . NET Compiler Platform, empowers the C# compiler on . NET Core and allows developers to leverage the rich code analysis APIs to perform code generation, analysis and compilation.
NET compiler platform (Roslyn) package versions are supported for different versions of Visual Studio.
Roslyn is a collection of open-source compilers, code analysis and refactoring tools which work with C# and Visual Basic source codes. This set of compilers and tools can be used to create full-fledged compilers, including, first and foremost, source code analysis tools.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With