By Jon Skeet


2008-10-29 17:09:40 8 Comments

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?

This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.

9 comments

@iTSrAVIE 2010-12-31 13:15:12

  • C# 1.0 with Visual Studio.NET

  • C# 2.0 with Visual Studio 2005

  • C# 3.0 with Visual Studio 2008

  • C# 4.0 with Visual Studio 2010

  • C# 5.0 with Visual Studio 2012

  • C# 6.0 with Visual Studio 2015

  • C# 7.0 with Visual Studio 2017

  • C# 8.0 with Visual Studio 2019 (in preview)

@Jon Skeet 2008-10-29 17:10:18

C# language version history:

These are the versions of C# known about at the time of this writing:

In response to the OP's question:

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?

There is no such thing as C# 3.5 - the cause of confusion here is that the C# 3.0 is present in .NET 3.5. The language and framework are versioned independently, however - as is the CLR, which is at version 2.0 for .NET 2.0 through 3.5, .NET 4 introducing CLR 4.0, service packs notwithstanding. The CLR in .NET 4.5 has various improvements, but the versioning is unclear: in some places it may be referred to as CLR 4.5 (this MSDN page used to refer to it that way, for example), but the Environment.Version property still reports 4.0.xxx.

As of May 3, 2017, the C# Language Team created a history of C# versions and features on their github repo: Features Added in C# Language Versions. There is also a page that tracks upcoming and recently implemented language features.

@Jon Skeet 2014-03-25 11:52:46

To whoever suggested including concurrent collections: this is a list of language features, not framework features. Note the lack of mentioning WPF, etc.

@BrainSlugs83 2015-06-18 16:05:28

Interesting Trivia (and potentially useful): you can target different versions of the framework / language than the default pairs listed above (for example, if you have a C# 5.0+ compiler, like what's shipped in VS2012+, you can use the caller info attributes of the C# 5.0 language while targeting .NET 4.0 for example.)

@nawfal 2015-08-20 09:52:05

Hmm so the CLR version for .NET 4.6 is still called 4.0? I expected it to change considering the changes to .NET and C#, you know RyuJIT, Roslyn, .NET Native etc.

@Jon Skeet 2015-08-20 09:53:38

@nawfal: Roslyn is irrelevant to that - and .NET native is somewhat separate. But basically, yes, I believe it's still 4.

@nawfal 2015-08-20 09:57:36

@JonSkeet I know Roslyn is just a C# compiler, but I assumed changes that must have gone to language and compiler would have forced design changes in CLR, along with modularizing .NET framework itself. Anyway good to know, thanks..

@Jon Skeet 2015-08-20 10:00:23

@nawfal: None of the language changes need any CLR changes.

@Alper 2015-10-14 14:51:03

I'm trying to figure out which of these versions Unity is on but I'm not having the best of luck.

@Jon Skeet 2015-10-14 15:26:13

@alper: Unity wouldn't be a specific version of C# so much as a specific version of the .NET framework and/or runtime. IIRC, it's effectively on CLR v2, but may have some aspects of .NET 3.5.

@Alper 2015-10-15 12:38:05

But both of those heavily influence the C# language features available to me right? The flavour of C# in Unity is fairly outdated and broken and it doesn't seem likely that it will converge any time soon.

@Jon Skeet 2015-10-15 12:40:38

@alper: Well, sort of. Some language features rely on platform support, but many don't. For example, most of the features in C# 6 would work fine on .NET 2.0. I'm still hopeful that Unity will update its runtime version at some point..

@markmnl 2016-05-19 00:47:00

What is still unclear to me here is what version of C# I am using if I create a .NET 4 project today? I suspect it is higher than C# 4 because ReSharper warns me about the breaking change with closure for earlier versions of C#!

@Jon Skeet 2016-05-19 05:36:19

@markmnl: A project doesn't generally have a specified C# version number... you could open the same project in different versions of Visual Studio and find the same code works in one but doesn't work in another. You can limit the C# version, although that's done on a syntactic rather than semantic basis. But yes, if you create a project targeting .NET 4 in Visual Studio 2015, you can use most C# 6 features...

@nawfal 2016-07-21 12:36:08

@JonSkeet I know the question is talking about C# versions, but wouldnt it be better to add a note on VS 2013 as well? For info: C# 5.0, VS2013, .NET 4.5.1, October 2013

@Jon Skeet 2016-07-21 12:39:45

@nawfal: I don't think so, no - I think it's pretty clear that VS2013, released between VS2012 and VS2015, is still going to be C# 5. If anyone wants a VS release version history, that's easily found on Wikipedia... this question is aimed at helping people use the right version number for C#. Adding more text that doesn't help on that front wouldn't be a good idea IMO.

@user9144 2017-01-12 10:42:19

I know it is not asked in the original question, but it will be really helpful: Can you add the canonical information source for each C# version? E.g. There is "C# 5 Language Specification" that can be found in Google. But where is C# 6 is documented?

@rory.ap 2017-04-10 13:40:06

@JonSkeet -- which version of VS includes v7.0? 2015 (with a hotfix maybe)? 2017? It's looking like the latter but I'm having a hard time nailing that info down.

@Jon Skeet 2017-04-10 13:41:58

@rory.ap: VS2017.

@Just a learner 2017-04-28 06:36:09

@JonSkeet I only have VS2015 Update 3 installed. Is it possible to try C# 7 features with it?

@Jon Skeet 2017-04-28 06:47:05

@OgrishMan: No - you'll need to install VS2017. (Or Visual Studio Code, or the latest .NET Core SDK.)

@Jon Skeet 2017-05-15 15:34:37

@Denis: VS2017 did not launch with .NET 4.7. .NET 4.7 is (apparently) included in a VS2017 update (although I don't appear to have it on my up-to-date box...) but that was in April 2017, whereas VS2017 with C# 7.0 launched in March without .NET 4.7.

@MacGyver 2017-10-09 17:44:58

Does .NET Core fit into this?

@Jon Skeet 2017-10-09 17:47:34

@MacGyver Um, sort of. The .NET Core SDK comes with a compiler, so I could potentially update it that way - but you can specify a compiler version in your project file anyway.

@Gusdor 2018-01-14 00:34:42

Am I correct that indexed members was withdrawn from C#6?

@Jon Skeet 2018-01-14 08:53:31

@Gusdor: Nope, new Dictionary<string, int> { ["x"] = 5 } is valid.

@Gusdor 2018-01-14 09:30:16

@JonSkeet Oh. I thought that was called 'element initializers'. I better go and read the docs :D

@Jon Skeet 2018-01-14 09:31:33

@Gusdor: I hadn't spotted that I'd got element initializers too. Will check later.

@Jon Skeet 2018-01-14 14:10:49

@Gusdor: Now I've looked again, the $x part has indeed gone, and I believe that's what was going to be "indexed members". Will remove from the answer

@Palec 2018-01-16 17:52:23

See What is the experimental feature “indexed members”? on Stack Overflow for the description of the withdrawn C# 6.0 feature "indexed members" and links to more info on the withdrawal.

@Jon Skeet 2018-01-16 18:00:42

@Palec: Yup, that's exactly the one I looked at :)

@Veverke 2018-06-24 11:22:19

My project targets framework 4.7. Following the answer above, I was expecting to be using C# 7. Why opening the project's properties, going to build tab -> advanced -> the language version combo box shows C# 6 as the maximum version ?

@Jon Skeet 2018-06-24 14:41:42

@Veverke: Sound like you're using VS2015 - you need VS2017 for C# 7.

@MgSam 2019-02-07 14:28:39

Wikipedia also references the mythical C# 1.1 version.

@Stephen Kennedy 2019-07-14 16:43:21

@JonSkeet The C# in Depth site article you link to is really helpful, but a little out of date. If you have a few minutes to spare it would be great if you could add summaries for the newer versions.

@Jon Skeet 2019-07-14 16:55:51

@StephenKennedy: I think it's best if I remove that link for the moment. The appendix at the end of C# in Depth 4th edition does have more information, but I'm not sure I really want to transcribe all of that...

@nawfal 2016-07-21 14:14:48

This is the same as most answers here, but tabularized for ease, and it has Visual Studio and .NET versions for completeness.

╔════════════╦════════════╦══════════════╦═════════════╦══════════════╗
║ C# version ║ VS version ║ .NET version ║ CLR version ║ Release date ║
╠════════════╬════════════╬══════════════╬═════════════╬══════════════╣
║    1.0     ║    2002    ║    1.0       ║     1.0     ║   Feb 2002   ║
║    1.2     ║    2003    ║    1.1       ║     1.1     ║   Apr 2003   ║
║    2.0     ║    2005    ║    2.0       ║     2.0     ║   Nov 2005   ║
║            ║            ║    3.0       ║     2.0     ║   Nov 2006   ║
║    3.0     ║    2008    ║    3.5       ║     2.0     ║   Nov 2007   ║
║    4.0     ║    2010    ║    4.0       ║     4       ║   Apr 2010   ║
║    5.0     ║    2012    ║    4.5       ║     4       ║   Aug 2012   ║
║    5.0     ║    2013    ║    4.5.1     ║     4       ║   Oct 2013   ║
║            ║            ║    4.5.2     ║     4       ║   May 2014   ║
║    6.0     ║    2015    ║    4.6       ║     4       ║   Jul 2015   ║
║            ║            ║    4.6.1     ║     4       ║   Nov 2015   ║
║            ║            ║    4.6.2     ║     4       ║   Aug 2016   ║
║    7.0     ║    2017    ║              ║             ║   Mar 2017   ║
║            ║            ║    4.7       ║     4       ║   May 2017   ║
║    7.1     ║ 2017(v15.3)║              ║             ║   Aug 2017   ║
║            ║            ║    4.7.1     ║     4       ║   Oct 2017   ║
║    7.2     ║ 2017(v15.5)║              ║             ║   Dec 2017   ║
║            ║            ║    4.7.2     ║     4       ║   Apr 2018   ║
║    7.3     ║ 2017(v15.7)║              ║             ║   May 2018   ║
║    8.0     ║    2019    ║              ║             ║   Apr 2019   ║    
╚════════════╩════════════╩══════════════╩═════════════╩══════════════╝

Note: .NET development is pretty much independent of VS these days, there is no correlation between versions of each. Refer to ".NET Framework versions and dependencies" for more.

@Pac0 2018-01-26 12:14:23

What about .NET Core versions ?

@nawfal 2018-02-06 13:15:02

@Pac0 .NET Core development is pretty much independent of VS development and is hard to keep track of (being open source). In fact all of VS, .NET and .NET Core are iterating quite fast.

@Mindless 2017-01-04 05:38:55

I've summarised most of the versions in this table. The only ones missing should be ASP.NET Core versions. I've also added different versions of ASP.NET MVC.

Note that ASP.NET 5 has been rebranded as ASP.NET Core 1.0 and ASP.NET MVC 6 has been rebranded as ASP.NET Core MVC 1.0.0. I believe this change occurred sometime around Jan 2016.

I have included the release date of ASP.NET 5 RC1 in the table, but I've yet to include ASP.NET core 1.0 and other core versions, because I couldn't find the exact release dates. You can read more about the release dates regarding ASP.NET Core here: When is ASP.NET Core 1.0 (ASP.NET 5 / vNext) scheduled for release?

Version

@Jon Skeet 2017-01-04 07:05:14

I'm not sure that having MVC in the same table is helpful, to be honest... it's just on a separate release schedule, effectively.

@Mindless 2017-01-04 07:22:38

@Jon This is true, just adding it here for anyone that might need it, because i did try to find out the correponding release dates of .NET frameworks, so that i get a better understanding of the whole version history.

@Milan 2016-01-26 12:33:57

C# Version History:

C# is a simple and powerful object-oriented programming language developed by Microsoft.

C# has evolved much since its first release in 2002. C# was introduced with .NET Framework 1.0.

The following table lists important features introduced in each version of C#.

Enter image description here

And the latest version of C# is available in C# Versions.

@Gennady Vanin Геннадий Ванин 2013-05-21 02:54:13

Comparing the MSDN articles "What's New in the C# 2.0 Language and Compiler" and "What's New in Visual C# 2005", it is possible to deduce that "C# major_version.minor_version" is coined according to the compiler's version numbering.

There is C# 1.2 corresponding to .NET 1.1 and VS 2003 and also named as Visual C# .NET 2003.

But further on Microsoft stopped to increment the minor version (after the dot) numbers or to have them other than zero, 0. Though it should be noted that C# corresponding to .NET 3.5 is named in msdn.microsoft.com as "Visual C# 2008 Service Pack 1".

There are two parallel namings: By major .NET/compiler version numbering and by Visual Studio numbering.

C# 2.0 is a synonym for Visual C# 2005

C# 3.0 corresponds (or, more correctly, can target) to:

@Jon Skeet 2013-05-21 10:22:16

No, C# corresponding to .NET 3.5 is named "Visual C# 2008" if you really want to use that numbering. The C# 3.0 features were introduced in "Visual C# 2008" which is why on the page you're linked to they're under "What's New in the Original Release Version of Visual C# 2008". Using the Visual Studio version numbers is a bad idea in general though, as it makes very little sense when you're building with Mono, for example. The C# language has well-specified version numbers... we know which Visual C# product originally introduced that version of C#, but they're not the same thing.

@Gennady Vanin Геннадий Ванин 2013-05-21 13:32:23

@JonSkeet, no, I don't. Wanted to ask you (and another answerer) update your answer but since my comment became too lengthy, I've decided then to put as answer. Thanks for your info

@nawfal 2016-07-21 14:22:34

I dont think C# 3.0 can run on VS 2005.

@Bryan Rehbein 2008-11-25 16:10:04

The biggest problem when dealing with C#'s version numbers is the fact that it is not tied to a version of the .NET Framework, which it appears to be due to the synchronized releases between Visual Studio and the .NET Framework.

The version of C# is actually bound to the compiler, not the framework. For instance, in Visual Studio 2008 you can write C# 3.0 and target .NET Framework 2.0, 3.0 and 3.5. The C# 3.0 nomenclature describes the version of the code syntax and supported features in the same way that ANSI C89, C90, C99 describe the code syntax/features for C.

Take a look at Mono, and you will see that Mono 2.0 (mostly implemented version 2.0 of the .NET Framework from the ECMA specifications) supports the C# 3.0 syntax and features.

@Pramodh 2010-05-07 11:08:21

VERSION_____LANGUAGE SPECIFICATION______MICROSOFT COMPILER

C# 1.0/1.2____December 2001?/2003?___________January 2002?

C# 2.0_______September 2005________________November 2005?

C# 3.0_______May 2006_____________________November 2006?

C# 4.0_______March 2009 (draft)______________April 2010?

C# 5.0; released with .NET 4.5 in August 2012

C# 6.0; released with .NET 4.6 2015

C# 7.0; released with .NET 4.7 2017

@Jon Skeet 2010-05-07 11:28:31

Where did you get a C# 2.0 language specification in December 2002 from? Likewise C# 4 in June 2006? Are you sure you're not talking about ECMA editions, which are completely different?

@Pramodh 2010-05-07 11:33:04

@Israel Ocbina 2014-10-14 21:25:14

You can check the latest C# versions here C# Versions

Related Questions

Sponsored Content

39 Answered Questions

26 Answered Questions

[SOLVED] Cast int to enum in C#

  • 2008-08-27 03:58:21
  • lomaxx
  • 1232636 View
  • 2937 Score
  • 26 Answer
  • Tags:   c# enums casting

26 Answered Questions

[SOLVED] How do I enumerate an enum in C#?

63 Answered Questions

[SOLVED] What is the difference between String and string in C#?

31 Answered Questions

[SOLVED] What is a NullReferenceException, and how do I fix it?

26 Answered Questions

[SOLVED] Why not inherit from List<T>?

42 Answered Questions

[SOLVED] How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?

  • 2008-09-29 22:30:28
  • mistrmark
  • 1026982 View
  • 1776 Score
  • 42 Answer
  • Tags:   c# .net excel file-io

63 Answered Questions

[SOLVED] How do I calculate someone's age in C#?

  • 2008-07-31 23:40:59
  • Jeff Atwood
  • 558116 View
  • 1742 Score
  • 63 Answer
  • Tags:   c# .net datetime

27 Answered Questions

[SOLVED] What is the best way to iterate over a dictionary?

  • 2008-09-26 18:20:06
  • Jake Stewart
  • 1428851 View
  • 2369 Score
  • 27 Answer
  • Tags:   c# dictionary loops

17 Answered Questions

[SOLVED] What do two question marks together mean in C#?

Sponsored Content