Using Roslyn compiler with Visual Studio 2013

后端 未结 1 1385
盖世英雄少女心
盖世英雄少女心 2021-01-04 11:20

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 opti

相关标签:
1条回答
  • 2021-01-04 12:07

    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.

    0 讨论(0)
提交回复
热议问题