C# Version History


Version

.Net Framework

Major Features

C# 1.0

.NET Framework 1.0/1.1

  • Classes
  • Structs
  • Interfaces
  • Events
  • Properties
  • Delegates
  • Operators and expressions
  • Statements
  • Attributes

C# 2.0

 


.NET Framework 2.0

 

  • Generics
  • Partial types
  • Anonymous methods
  • Nullable value types
  • Iterators
  • Covariance and contravariance 


C# 3.0

 

.NET Framework version 3.5

  • 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

  • Dynamic binding
  • Named/optional arguments
  • Generic covariant and contravariant
  • Embedded interop types 

C# 5.0

 

.NET Framework 4.5

  • Asynchronous members
  • Caller info attributes

C# 6.0

 

.NET Framework 4.6

 

  • 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 Core 2.0

  • 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

 

  • 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.0

 

.NET 5.0

  • 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 

C#10.0

.NET 6.0

 

  • 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 




Post a Comment

Previous Post Next Post