patterncsharpCritical
What are the correct version numbers for C#?
Viewed 0 times
numbersarecorrecttheforwhatversion
Problem
What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?
This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.
This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.
Solution
C# language version history:
These are the versions of C# known about at the time of this writing:
These are the versions of C# known about at the time of this writing:
- C# 1.0 released with .NET 1.0 and VS2002 (January 2002)
- C# 1.2 (bizarrely enough); released with .NET 1.1 and VS2003 (April 2003). First version to call
DisposeonIEnumerators which implementedIDisposable. A few other small features.
- C# 2.0 released with .NET 2.0 and VS2005 (November 2005). Major new features: generics, anonymous methods, nullable types, and iterator blocks
- C# 3.0 released with .NET 3.5 and VS2008 (November 2007). Major new features: lambda expressions, extension methods, expression trees, anonymous types, implicit typing (
var), and query expressions
- C# 4.0 released with .NET 4 and VS2010 (April 2010). Major new features: late binding (
dynamic), delegate and interface generic variance, more COM support, named arguments, tuple data type and optional parameters
- C# 5.0 released with .NET 4.5 and VS2012 (August 2012). Major features: async programming, and caller info attributes. Breaking change: loop variable closure.
- C# 6.0 released with .NET 4.6 and VS2015 (July 2015). Implemented by Roslyn. Features: initializers for automatically implemented properties, using directives to import static members, exception filters, element initializers,
awaitincatchandfinally, extensionAddmethods in collection initializers.
- C# 7.0 released with .NET 4.7 and VS2017 (March 2017). Major new features: tuples, ref locals and ref return, pattern matching (including pattern-based switch statements), inline
outparameter declarations, local functions, binary literals, digit separators, and arbitrary async returns.
- C# 7.1 released with VS2017 v15.3 (August 2017). New features: async main, tuple member name inference, default expression, and pattern matching with generics.
- C# 7.2 released with VS2017 v15.5 (November 2017). New features: private protected access modifier, Span, aka interior pointer, aka stackonly struct, and everything else.
- C# 7.3 released with VS2017 v15.7 (May 2018). New features: enum, delegate and
unmanagedgeneric type constraints.refreassignment. Unsafe improvements:stackallocinitialization, unpinned indexedfixedbuffers, customfixedstatements. Improved overloading resolution. Expression variables in initializers and queries.==and!=defined for tuples. Auto-properties' backing fields can now be targeted by attributes.
- C# 8.0 released with .NET Core 3.0 and VS2019 v16.3 (September 2019). Major new features: nullable reference-types, asynchronous streams, indices and ranges, readonly members, using declarations, default interface methods, static local functions, and enhancement of interpolated verbatim strings.
- C# 9 released with .NET 5.0 and VS2019 v16.8 (November 2020). Major new features: init-only properties, records, with-expressions, data classes, positional records, top-level programs, improved pattern matching (simple type patterns, relational patterns, logical patterns), improved target typing (target-type
newexpressions, target typed??and?), and covariant returns. Minor features: relax ordering ofrefandpartialmodifiers, parameter null checking, lambda discard parameters, nativeints, attributes on local functions, function pointers, static lambdas, extensionGetEnumerator, module initializers, and extending partial.
- C# 10 released with .NET 6.0 (November 2021). Major new features: record structs, struct parameterless constructors, interpolated string handlers, global
usingdirectives, file-scoped namespace declarations, extended property patterns, const interpolated strings, mixed assignment and declaration in deconstruction, async method builders (via attributes) for individual methods, theCallerArgumentExpressionattribute for parameters, enhanced#linepragmas.
- C# 11 released with .NET 7.0 (November 2022). Major new features: file-scoped types, generic math support, auto-default structs, pattern match
Spanon a constant string, extended nameof scope, numericIntPtr, UTF-8 string literals, required members,reffields andscoped ref, raw string literals, improved method group conversion to delegate, warning wave 7, generic attributes, newlines in string interpolation expressions, list patterns
- C# 12 released with .NET 8.0 (November 2023). Major new features: primary constructors, collection expressions, inline arrays, optional parameters in lambda expressions,
ref readonlyparameters, alias any type,Experimentalattribute, interceptors
- C# 13 releasing with .NET 9.0 (November 2024). Major new features: params collections, new
Locktype and semantics, new Escape sequence\e, method group natural type improvements, implicit indexer access in object initializers, ref locals and unsafe contexts in iterators and async methods, ref struct types to can implement interfaces, partial properties and indexers, ref struct types, overload resolution prio
Context
Stack Overflow Q#247621, score: 3237
Revisions (0)
No revisions yet.