(摘自:*)https://en.wikipedia.org/wiki/C_Sharp_(programming_language)
Versions
Version | Language specification | Date | .NET Framework | Visual Studio | ||
---|---|---|---|---|---|---|
ECMA | ISO/IEC | Microsoft | ||||
C# 1.0 | December 2002 | April 2003 | January 2002 | January 2002 | .NET Framework 1.0 | Visual Studio .NET 2002 |
C# 1.1 and 1.2 | October 2003 | April 2003 | .NET Framework 1.1 | Visual Studio .NET 2003 | ||
C# 2.0 | June 2006 | September 2006 | September 2005[c] | November 2005 | .NET Framework 2.0 | Visual Studio 2005 |
C# 3.0 | None[d] | August 2007 | November 2007 |
.NET Framework 2.0 (Except LINQ)[36] |
Visual Studio 2008 Visual Studio 2010 |
|
C# 4.0 | April 2010 | April 2010 | .NET Framework 4 | Visual Studio 2010 | ||
C# 5.0 | In Progress[37] | None[d] | June 2013 | August 2012 | .NET Framework 4.5 |
Visual Studio 2012 Visual Studio 2013 |
C# 6.0 | None[d] | Draft | July 2015 | .NET Framework 4.6 | Visual Studio 2015 | |
C# 7.0 | None | March 2017 | .NET Framework 4.6.2 | Visual Studio 2017 | ||
C# 7.1 | None | None | None | August 2017 | .NET Framework 4.6.2 | Visual Studio 2017 |
New features
- C# 2.0
- Generics[38]
- Partial types[38]
- Anonymous methods[38]
- Iterators[38]
- Nullable types[38]
- Getter/setter separate accessibility[38]
- Method group conversions (delegates)[38]
- Co- and Contra-variance for delegates[38]
- Static classes[38]
- Delegate inference[38]
- C# 3.0
- Implicitly typed local variables[39]
- Object and collection initializers[39]
- Auto-Implemented properties[39]
- Anonymous types[39]
- Extension methods[39]
- Query expressions[39]
- Lambda expression[39]
- Expression trees[39]
- Partial methods[40]
- C# 4.0
- Dynamic binding[41]
- Named and optional arguments[41]
- Generic co- and contravariance[41]
- Embedded interop types ("NoPIA")[41]
- C# 5.0[42]
- C# 6.0
- Compiler-as-a-service (Roslyn)
- Import of static type members into namespace[44]
- Exception filters[44]
- Await in catch/finally blocks[44]
- Auto property initializers[44]
- Default values for getter-only properties[44]
- Expression-bodied members[44]
- Null propagator (null-conditional operator, succinct null checking)[44]
- String interpolation[44]
- nameof operator[44]
- Dictionary initializer[44]
- C# 7.0[45]
- Out variables
- Pattern matching
- Tuples
- Deconstruction
- Local functions
- Digit separators
- Binary literals
- Ref returns and locals
- Generalized async return types
- Expression bodied constructors and finalizers
- Expression bodied getters and setters
- C# 7.1[46]
- Async main
- Default literal expressions
- Inferred tuple element names