C# Version History and features
C# – Pronounced as CSharp. C# is the programming language and .NET Framework is a cross-platform development platform for building software, developed by Microsoft. The first version of C# was introduced with .Net Framework 1.0 in 2002. In the past 20 years, Microsoft has introduced many C# Versions with new features & enhancements. The Microsoft community is still growing stronger with its latest C# Version.
C# Version Overview
- C# 1 was introduced in 2002 with .NET Framework 1.0 and Visual Studio 2002
- C# 1.2 was introduced in 2003 with .NET Framework 1.1 and Visual Studio 2003
- C# 2 was introduced in 2005 with .NET Framework 2.0 and Visual Studio 2005.
And later .NET Framework 3.0 and Visual Studio 2008 - C# 3 was introduced in 2007 with .NET Framework 3.0 & 3.5 and Visual Studio 2008
- C# 4 was introduced in 2010 with .NET Framework 4.0 and Visual Studio 2010
- C# 5 was introduced in 2012 with .NET Framework 4.5 and Visual Studio 2012
- C# 6 was introduced in 2015 with .NET Framework 4.6 and Visual Studio 2015
Parallelly, .NET Core 1.0 and 1.1 were also got released. - C# 7 was introduced in 2017 with .NET Framework 4.7, .NET Core 2.0, and Visual Studio 2017
- C# 8 was introduced in 2019 with .NET Core 3.0 and Visual Studio 2019.
And later, .NET Core 3.1 was also got released. - C# 9 was introduced in 2020 with .NET Core 5.0 and Visual Studio 2019
- C# 10 was introduced in 2021 with .NET Core 6.0 and Visual Studio 2022
C# Versions and features
The following table shows important features introduced in each C# version:
C# Version | .Net Framework | Visual Studio | Features |
---|---|---|---|
C# 1.0 | .NET Framework 1.0 | Visual Studio .NET 2002 | > Classes > Structs > Interfaces > Events > Properties > Delegates > Operators and expressions > Statements > Attributes |
C# 1.2 | .NET Framework 1.1 | Visual Studio .NET 2003 | few small enhancements – the code generated in a foreach loop called Dispose on an IEnumerator when that IEnumerator implemented IDisposable |
C# 2.0 | .NET Framework 2.0 | Visual Studio 2005 | > Generics > Partial types > Anonymous methods > Nullable value types > Iterators > Covariance and contravariance Other existing features enhanced: > Getter/setter separate accessibility > Method group conversions (delegates) > Static classes > Delegate inference |
C# 3.0 | .NET Framework 3.0, 3.5 | Visual Studio 2008 | > Auto-implemented properties > Anonymous types > Query expressions > Lambda expressions > Expression trees > Extension methods > Implicitly typed local variables > Partial methods > Object and collection initializers |
C# 4.0 | .NET Framework 4.0 | Visual Studio 2010 | > Dynamic binding > Named/optional arguments > Generic covariant and contravariant > Embedded interop types |
C# 5.0 | .NET Framework 4.5 | Visual Studio 2012/ 2013 | > Asynchronous members > Caller info attributes |
C# 6.0 | .NET Framework 4.6, .NET Core 1.0, .NET Core 1.1 | Visual Studio 2015 | > Static imports > Exception filters > Auto-property initializers > Expression bodied members > Null propagator > String interpolation > nameof operator > Index initializers > Await in catch/finally blocks > Default values for getter-only properties |
C# 7.0 | .NET Framework 4.7, .NET Core 2.0, .NET Core 2.1, .NET Core 2.2, .NET Framework 4.8 | Visual Studio 2017 | > Out variables > Tuples and deconstruction > Pattern matching > Local functions > Expanded expression bodied members > Ref locals and returns > Discards > Binary Literals and Digit Separators > Throw expressions |
C# 8.0 | .NET Core 3.0, .NET Core 3.1 | Visual Studio 2019 | > Readonly members > Default interface methods > Pattern matching enhancements: >> Switch expressions >> Property patterns >> Tuple patterns >> Positional patterns > Using declarations > Static local functions > Disposable ref structs > Nullable reference types > Asynchronous streams > Indices and ranges > Null-coalescing assignment > Unmanaged constructed types > Stackalloc in nested expressions > Enhancement of interpolated verbatim strings |
C# 9 | .NET Core 5.0 | Visual Studio 2019 | > Records > Init only setters > Top-level statements > Pattern matching enhancements > Performance and interop >> Native sized integers >> Function pointers >> Suppress emitting localsinit flag > Fit and finish features >> Target-typed new expressions >> static anonymous functions >> Target-typed conditional expressions >> Covariant return types >> Extension GetEnumerator support for foreach loops >> Lambda discard parameters >> Attributes on local functions > Support for code generators >> Module initializers >> New features for partial methods |
C# 10 | .NET Core 6.0, .NET Core 6.0.1 | Visual Studio 2022 | > Record structs > Improvements of structure types > Interpolated string handlers > global using directives > File-scoped namespace declaration > Extended property patterns > Improvements on lambda expressions > Allow const interpolated strings > Record types can seal ToString() > Improved definite assignment > Allow both assignment and declaration in the same deconstruction > Allow AsyncMethodBuilder attribute on methods > CallerArgumentExpression attribute > Enhanced #line pragma > Warning wave 6 |
C# 11 | .NET Core 6.0.2 | Visual Studio 2022 | > Raw string literals > Generic math support > Generic attributes > UTF-8 string literals > Newlines in string interpolation expressions > List patterns > File-local types > Required members > Auto-default structs > Pattern match Span on a constant string > Extended nameof scope > Numeric IntPtr > ref fields and scoped ref > Improved method group conversion to delegate > Warning wave 7 |
* C# 12 | .NET 8 | Visual Studio 2022 | > Primary constructors > Collection expressions > Default lambda parameters > Alias any type > Inline arrays > Interceptors |
* The final version is not yet released and these are currently preview features. All features may not be released in C# version 12, some may remain in a preview phase for a longer time. more..
That’s all about C# Versions from 2002 to till date. Please leave your valuable feedback, if any.
Thanks 🙂