What’s the right way to call the C#versions?

Asked

Viewed 1,702 times

18

There seems to be some confusion with the nomenclature of the versions of C# and the technologies that are related to it.

Is there a C# 2005? Or a C# 3.5? How do C# versions relate to . Net, Visual Studio, etc.?

There are books that use names like C# 2008 (another example). That is correct?

1 answer

21


C# CLR .NET Framework .NET Core Visual Studio Launching
1.0 1.0 1.0 - .NET (7.0) January 2002
1.2 1.1 1.1 - .NET 2003 (7.1) April 2003
2.0 2.0 2.0 - 2005 (8.0) November 2005
3.0 - November 2006
3.0 3.5 - 2008 (9.0) November 2007
4.0 4 4.0 - 2010 (10.0) April 2010
5.0 4.5 - 2012 (11.00) August 2012
4.5.1 - 2013 (12.0) October 2013
4.5.2 - May 2014
6.0 4.6 - 2015 (14.0) July 2015
4.6.1 - 2015 Update 1 November 2015
4.6.2 1.0 2015 Update 3 July 2016
August 2016
7.0 1.1.1 2017 (15.0) March 2017
7.1 4.7 2.0 2017 (15.3) August 2017
7.2 4.7.1 2015 (15.5) November 2017
7.3 4.7.2 2.1 2017 (15.7) May 2018
2.2 2017 (15.9) December 2018
8.0 4.8 3.0 2019 (16.2) September 2019
- - 3.1 2019 (16.3) November 2019
9.0 - - 5 2019 (16.8) November 2020
10.0 - - 6 2022 (17.0) November 2021
11.0? - - 7 2022 (17.?) November 2022
12.0? - - 8 2022 (17.?) November 2023

There are some curiosities in this listing.

  • There is a version of C# called 1.2 but it is virtually unknown. In addition to minor changes the interface was created IDisposable and all that is necessary for its operation. Some resources, such as the IEnumerator, started using it.
  • The version of . NET Framework (called just .NET in the table) is not synchronized with the language version, after all . NET is not unique to C#. Then one might think that because there is a . NET 3.5 there must be a C# 3.5. That is not the case.
  • Version 3.0 of . NET in the background is . NET 2.0 with extra libraries (WPF, WCF, WF, etc.).
  • Visual Studio was initially called . NET because all Microsoft products would be called that, but this was later abandoned. There is a trademark that follows the approximate years of its release and a technical version. Versions prior to 7.0 existed but did not include . NET.
  • . NET Framework 4.8 is the only one that will at some point be supported indefinitely and will not evolve.
  • The following version of .NET Core 3.1 is the .NET 5, without the term Core in the name.

Evolution of the C#

  • C# 2.0 introduced Generics, Partial types, Anonymous methods, Nullable types, separate accessibility for Getter/Setter, Method group conversions (delegates), Covariance/Counter-variance and Static classes.
  • C# 3.0 introduced implicitly typed local variables, initializers for objects and collections, self-applied properties, Anonymous types, Extension methods, Query Expressions, Lambda Expressions, Expression Trees and Partial Methods.
  • C# 4.0 introduced Dynamic Binding, Named and optional Arguments, Generic co- and contravariance and Embedded Interop types ("Nopia").
  • C# 5.0 introduced Asynchronous methods and Caller info Attributes.
  • C# 6.0 introduced the . Net Compiler Platform (Roslyn), auto-properties initializers, Using importing static members, Exception Filters, event initializers, await inside catch and finally, Extension Add methods, collection initializers, null propagation, Expression-bodied Members, operator nameof, interpolation of strings.
  • C# 7.0 introduced tuples, out var, binary literals and separators, local functions, ref Returns, Expression-bodied everywhere, Type Switch and arbitrary async.
  • C# 7.1 introduced async Main, default literal Expressions, inference in tuple names.
  • C# 7.2 introduced reference semantics for types per value ( ref), private proteced, arguments named out of the end, numeric literal with underscore at the end.
  • C# 7.3 introduced fixed fields without pinning and use in other types that were not possible, initializers in stackalloc, new possibilities for generic restriction such as enum and delegate, reallocation of local variables with ref.
  • C# 8.0 introduced default implementation on the interface, overridable reference types, recursive Patterns, async streams, using by scope, ranges and Dexes, ??= , alternative syntax for interpolated strings, stackalooc in nested context, unmanaged generic in struct, static local Function, members readonly.
  • C# 9.0 will introduce statements loose, Records, return covariant, target-typed new, relaxation in the order of ref and partial, improvements in Pattern matching, Parameter null-checking, Skip locals init, lambda discard Parameters, int native, local function attribute, function pointers, Amble static, conditional operator improvement, extension of GetEnumerator(), module initializers.
  • C# 10.0 comes Caller Expression attribute, Generic Attributes, default in Deconstruction, strings constant interpolated.

Some restrictions on the use of combined technologies exist:

  • Cannot use C# 2 (it is common to omit release language version) without . NET 2.0.
  • . NET 3.5 is required to use C# 3. However most Features C# 3 can be used even with . NET 2.0 or 3.0.
  • You can select the version of . NET that your application should run. VS 2005 onwards, under normal conditions, cannot use . NET 1.0 and 1.1 as target of the application.
  • It is not possible to ask a VS version to restrict Features C# versions lower than those installed on it.
  • Each version of VS has a different project file format and a conversion from the old one will be done automatically.

Note that the versions of . NET refer to the . NET Framework. Do not confuse with . NET as a whole platform which obviously has no version. OR with . NET Core which is another product. NET 5 yes becomes an official name for what was once called . NET Core.

. NET has some divisions like FCL (Framework Class Library) which is a superset from the BCL (Base Class Library). BCL is required in any implementation that want compatibility with . NET (Mono for example implements all BCL and parts of FCL). In FCL is included Windows Forms, WPF, ASP.NET, etc. FCL makes less sense in . NET Core, the model has changed and the components are more isolated.

To CLR (Common Language Runtime) is the virtual machine that controls applications written for .NET. Note that it is much more stable and evolves on rare occasions. She’s the one with all the security controls, Garbage Collector, handling of exceptions, the Jitter, control of threads, etc..

There is even a Visual Studio C# 2010, for example. It is Visual Studio specific to C# (at least one way to use it). But the language does not call C# 2010.

Microsoft documentation.

The question and answer were inspired by post by Jon Skeet.

  • 1

    Note that the latest ISO standard of C# stopped at 2.0 (ISO/IEC 23270:2006). Later versions are Microsoft initiatives.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.