27

The title says it all: what CLR version is / will be needed to run C# 6 programs? The CLR version is interesting to find out the system requirements and supported operating systems.

I googled [1] [2] and had a look at Wikipedia and MSDN but could not find the information.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • 6
    What's been talked about so far is just syntax sugar, it doesn't require any new CLR features. Using CLR v4.0.30319 should work just fine. CLR versioning was never driven by compiler changes anyway. The sane thing to do of course is just wait until it is actually released, then you *know*. – Hans Passant May 12 '14 at 13:52
  • 1
    See http://stackoverflow.com/questions/28921701/does-c-sharp-6-0-work-for-net-4-0 – slashCoder Jan 05 '16 at 18:54
  • If you are here to find out how to get the C# 6 language features, then I think @Pankaj answer is best. It explains why this isn't actually a CLR question and what you need if you are using Visual Studio as your IDE. – Mike Sep 22 '17 at 23:21

3 Answers3

22

C # 6 language enhancements is compatible to .net framework starting from 2.0 to 4.6. It does not require any higher version of .net framework but need higher version of Visual studio such as VS 2015. C# 6 is also available to VS 2013 with addon https://github.com/dotnet/roslyn

Pankaj
  • 244
  • 2
  • 4
9

It is version 4 of CLR that is used. If you test Environment.Version in Visual Studio "14" CTPs you will get:

4.0.30319.35317

With code:

Console.WriteLine(Environment.Version);

enter image description here

Also if you look at Common Language Runtime (CLR) on MSDN you will find:

.Net Framework Version                     CLR Version
4.5 (including 4.5.1 and 4.5.2)            4
Habib
  • 219,104
  • 29
  • 407
  • 436
6

In order to have C# 6 you need:

VS 2013 runs on .NET 4.5.1 so I guess the answer to your Question is 4.5.1

apomene
  • 14,282
  • 9
  • 46
  • 72