C# 1.0 |
.NET framework 1.0 |
Visual Studio 2002 |
- Classes
- Structs
- Interfaces
- Events
- Properties
- Delegates
- Expressions
- Statements
- Attributes
- Literals
|
C# 1.2 |
.NET Framework 1.1 |
-- |
- Dispose in foreach
- foreach over string specialization
|
C# 2.0 |
.NET Framework 2.0 |
Visual Studio 2005 |
- Generics
- Partial types
- Anonymous methods
- Iterators
- Nullable types
- Getter/setter separate accessibility
- Method group conversions (delegates)
- Static classes
- Delegate inference
|
C# 3.0 |
.NET Framework 3.0/3.5 |
Visual Studio 2008 |
- Implicitly typed local variables
- Object and collection initializers
- Auto-Implemented properties
- Anonymous types
- Extension methods
- Query expressions
- Lambda expression
- Expression trees
- Partial methods
|
C# 4.0 |
.NET Framework 4.0 |
Visual Studio 2010 |
- Dynamic binding (late binding)
- Named and optional arguments
- Generic co- and contravariance
- Embedded interop types
|
C# 5.0 |
.NET Framework 4.5 |
Visual Studio 2012/2013 |
- Async features
- Caller information
|
C# 6.0 |
.NET Framework 4.6 |
Visual Studio 2013/2015 |
- Expression Bodied Methods
- Auto-property initializer
- nameof operator
- Primary constructor
- Await in catch/finally blocks
- Exception Filter
- String Interpolation
- Compiler-as-a-service (Roslyn)
- Null propagator (null-conditional operator, succinct null checking)
- Dictionary initializer
|
C# 7.0 |
.NET Core |
Visual Studio 2017 |
- out variables
- Pattern matching
- Tuples
- Deconstruction
- Discards
- Pattern Matching
- Local functions
- Generalized async return types
- throw Expressions
- Ref returns and locals
- Digit Separators
- Binary Literals
|
C# 7.1 |
.NET Framework 4.7 |
Visual Studio 2017 version 15.3 |
- async Main method
- default literal expressions
- Inferred tuple element names
- Pattern matching on generic type parameters
|
C# 7.2 |
.NET Framework 4.7.1 |
Visual Studio 2017 version 15.5 |
- Techniques for writing safe efficient code
- Non-trailing named arguments
- Leading underscores in numeric literals
- private protected access modifier
- Conditional ref expressions
|
C# 7.3 |
.NET Framework 4.7.2 |
Visual Studio 2017 version 15.7 |
- initializers on stackalloc arrays.
- fixed statements with any type that supports a pattern.
- System.Enum, System.Delegate and unmanaged constraints.
- Improved overload candidates
- Tuple comparison
- Expression variables in initializers and queries
|
C# 8.0 |
.NET Framework 4.8, .NET Core 3.0 |
Visual Studio 2019 version 16.3 |
- Nullable reference types
- Default interface members
- Recursive patterns
- Async streams
- Readonly members
- Static local functions
- Null-coalescing assignment
- Ranges and indexes
- Enhanced using
|
C# 9.0 |
C# 9.0 is supported on .NET 5. |
Visual Studio 2019 version 16.8, Preview 4 |
- Records
- Init only setters
- Top-level statements
- Pattern matching enhancements
- Native sized integers
- Function pointers
- Suppress emitting localsinit flag
- 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\
- Module initializers
- New features for partial methods
|
C# 10 |
Supported in .NET 6 and .NET 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
|
C# 11 |
Beginning with the .NET 6.0.200 |
Visual Studio 2022 version 17.1 |
- Generic attributes.
- static abstract members in interfaces.
- Newlines in string interpolation expressions.
- Simplified parameter null checks.
|