C# language version history
C# 1.0
Introduced with .NET Framework 1.0 in January 2022, C# 1.0 established the foundation of the language with basic object-oriented programming features, including classes, structs, interfaces, events, properties, and delegates.
The language had the following goals:
- It is intended to be simple, modern, general purpose, and object oriented programming language.
- It should include strong type checking, array bound checking, detection of attempts to use uninitialized variables, source code portability and automatic garbage collection.
- It is intended for use in developing software components than can take advantage of distributed environments.
- As programmer portability is very much important, especially for those programmers already familiar with C & C++, C# is best suitable.
- Provide support for internationalization, as it was very important.
- It is intended to be suitable for writing applications for both hosted and embedded systems.
C# 2.0
Introcudec in 2005, this version brought significant enhancements such as generics for type-safe data structures, anonymous methods for inline delegate definitions, nullable value types, iterators with the yield
keyword, partial types allowing class definitions across multiple files, and static classes.
C# 3.0
Released in 2007, C# 3.0 introduced features that facilitated Language Integrated Query (LINQ), including implicitly typed local variables (var
), object and collection initializers, auto-implemented properties, anonymous types, extension methods, lambda expressions, expression trees, and partial methods.
C# 4.0
Introduced in 2010, C# 4.0 focused on interoperability and dynamic programming by adding dynamic binding (dynamic
keyword), named and optional arguments, generic covariance and contravariance, and embedded interop types to simplify COM interoperability.
C# 5.0
Released in 2012, C# 5.0 introduced asynchronous programming with the async
and await
keywords, simplifying the development of responsive applications. It also added caller information attributes to obtain file path, line number, and member name of the caller.
C# 6.0
Introduced in 2015, C# 6.0 brought several syntax enhancements for more concise code, including expression-bodied members, auto-property initializers, the nameof
operator, null-conditional operators (?.
and ?[]
), string interpolation, and exception filters.
C# 7.0
Released in 2017, C# 7.0 introduced tuples and deconstruction for grouping multiple values, pattern matching for enhanced type inspections, local functions, out variables for inline declaration, and enhanced support for asynchronous programming with generalized async return types.
C# 8.0
Released in 2019, C# 8.0 added nullable reference types to improve null safety, default interface methods, asynchronous streams with async
iterators, indices and ranges for array slicing, and switch expressions for more concise conditional logic.
C# 9.0
Released in 2020, C# 9.0 introduced record types for immutable data models, init-only properties, top-level statements for simplified program structure, improved pattern matching with relational and logical patterns, and with
expressions for non-destructive mutation of records.
C# 10.0
Introduced in 2021, C# 10.0 brought features like global using directives, file-scoped namespace declarations, record structs for value-type records, improved lambda expressions, and constant interpolated strings, enhancing code simplicity and performance.
C# 11.0
Released in 2022, C# 11.0 introduced raw string literals for easier multi-line string handling, generic attributes, required members to enforce object initialization, list patterns for pattern matching on collections, and UTF-8 string literals for performance improvements.
C# 12.0
Released in 2023, C# 12.0 added primary constructors for non-record classes and structs, allowing for more concise initialization, and expanded pattern matching capabilities with new patterns and enhancements. For a complete list, check out what’s new in C# 12.0.
C# 13.0
Released in 2024, C# 13.0 introduced params collections, allowing the params
modifier to be used with any recognized collection type, new lock type and semantics for more efficient locking mechanisms, the \e
escape sequence representing the ESC character, and method group natural type improvements for more intuitive method group conversions.