How can I add C# 6.0 to Visual Studio 2013? [duplicate]

拜拜、爱过 提交于 2019-11-30 08:02:27

问题


Is there any way to add C# 6.0 to Visual Studio 2013? If I can't why is that?


回答1:


The best you can currently do for VS2013 is download the April End User Preview, which is pretty outdated by now.

The VS2013 compiler (as is) doesn't "understand" C#-6 features. Most, if not all of the C# new features are syntactic sugar which the compiler interprets and emits different code for. In order for VS2013 to support that, it has to upgrade the compiler to support those features.

Not to mention VS2015 will bring with it a completely new CSC, named Roslyn

For example, expression body properties:

public override string ToString() => string.Format("{0}, {1}", First, Second);

Compiles down to:

public override string ToString()
{
   return string.Format("{0}, {1}", First, Second);
}


来源:https://stackoverflow.com/questions/27462553/how-can-i-add-c-sharp-6-0-to-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!