13

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

Yuval Itzchakov
  • 146,575
  • 32
  • 257
  • 321
Mohamad Shiralizadeh
  • 8,329
  • 6
  • 58
  • 93

1 Answers1

13

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);
}
Yuval Itzchakov
  • 146,575
  • 32
  • 257
  • 321