C # as Microsoft 2000 later. NET platform development of the language, the development has been 17 years of history, the language itself has a wealth of characteristics, Microsoft's support for its update is also very supportive. Microsoft has submitted C # to the standard organization Ecma,c# 5.0 is currently the latest specification for ECMA release, C # 6.0 is a draft phase, and C # 7.1 is the latest specification that Microsoft is currently offering.
This is just an outline, because C # 5.0 is a version with the ECMA standard specification, so choose C # 5.0 as the major version and learn the new features of C # 6.0, 7.0.
C # Language Specification GitHub library See also: Https://github.com/dotnet/csharplang
C # language Roadmap and features in development see:
Https://github.com/dotnet/roslyn/blob/master/docs/Language%20Feature%20Status.md
language version |
Release Time |
. NET Framework Requirements |
Visual Studio Version |
C # 1.0 |
2002.1 |
. NET Framework 1.0 |
Visual Studio. NET 2002 |
C # 1.1\1.2 |
2003.4 |
. NET Framework 1.1 |
Visual Studio. NET 2003 |
C # 2.0 |
2005.11 |
. NET Framework 2.0 |
Visual Studio 2005 |
C # 3.0 |
2007.11 |
. NET Framework 2.0\3.0\3.5 |
Visual Studio 2008 |
C # 4.0 |
2010.4 |
. NET Framework 4.0 |
Visual Studio 2010 |
C # 5.0 |
2012.8 |
. NET Framework 4.5 |
Visual Studio 2012\2013 |
C # 6.0 |
2015.7 |
. NET Framework 4.6 |
Visual Studio 2015 |
C # 7.0 |
2017.3 |
. NET Framework 4.6.2 |
Visual Studio 2017 |
C # 7.1 |
2017.6 |
. NET Framework |
Visual Studio v15.3 |
C # 8.0 |
Pending release |
. NET Framework 4.7.1 |
|
C # 1.0 features (Visual Studio.NET)
- Classes: Object-oriented features, supporting class types
- STRUCTS: Structure
- Interfaces: interface
- Events: Event
- Properties: A member of a class that provides a flexible way to access fields
- Delegates: Delegate, a reference type that represents a reference to a method with a specific argument list and return type
- Expressions,statements,operators: expressions, statements, operators
- Attributes: An attribute that adds metadata or declarative information to a program code, which can be accessed by reflection at run time
- Literals: literal (or understood as a constant value), distinguishing constants, constants are relative to variables
C # 2 features (VS 2005)
- Generics: Generics
- Partial types: Partial types, which can split type definitions of classes, structs, interfaces, etc. into multiple files
- Anonymous methods: Anonymous method
- Iterators: iterators
- Nullable types: Nullable type, the class can be a different value, or null
- Getter/setter Separate accessibility: Property access control
- Method group conversions (delegates): Methods set conversions, which can represent a set of methods in a declaration delegate, implicitly invoking the
- Co-and Contra-variance for delegates and interfaces: Covariance and contravariance of delegates, interfaces
- Static classes: Statically class
- Delegate inference: Delegate inference, allowing method names to be directly assigned to delegate variables
C # 3 features (VS 2008)
- Implicitly typed Local variables:
- Object and collection initializers: Objects and collection initializers
- auto-implemented properties: Automatic attributes, automatic attribute generation method, more concise declaration
- Anonymous types: Anonymous Type
- Extension methods: Extension method
- Query expressions: Querying expressions
- Lambda EXPRESSION:LAMBDA Expression
- Expression trees: Expressions tree, a tree-shaped data structure representing code, is a new type of data
- Partial methods: Partial Methods
C # 4 features (VS 2010)
- Dynamic binding: Dynamically bound
- Named and optional arguments: named parameters and Optional parameters
- Generic Co-and contravariance: Covariance and contravariance of generics
- Embedded Interop Types ("Nopia"): Enables embedding type information to increase the neutrality of referencing COM component programs
C # 5 features (VS 2012)
- Asynchronous methods: Async method
- Caller Info attributes: Caller information attribute, Access caller's information when invoking
C # 6 features (VS 2015)
- Compiler-as-a-service (Roslyn)
- Import of static type member into namespace: supports only static members in the Import class
- Exception Filters: Exception filter
- Await in catch/finally blocks: supports using await statements in catch/finally statement blocks
- Auto Property Initializers: Automatic attribute initialization
- Default values for Getter-only properties: Set defaults for read-only attributes
- Expression-bodied members: Support for member methods and read-only properties that are subject to an expression
- Null propagator (null-conditional operator, succinct null checking): null condition operator
- String interpolation: A new method for generating a specific format string by inserting strings
- nameof operator:nameof operator, returns the name of the method, property, variable
- Dictionary initializer: Dictionary initialization
C # 7 features (Visual Studio 2017)
- Out variables:out variables are directly declared, for example, can be out-in parameter
- Pattern matching: schema matching, distributed according to object type or other attribute implementation method
- Tuples: Tuples
- Deconstruction: meta-group parsing
- Discards: No named variable, only placeholder, the following code does not need to use its value
- Local Functions: Partial function
- Binary literals: binary literal
- Digit Separators: Number separator
- REF returns and locals: reference return value and local variable
- Generalized use of generic return types in Async return Types:async
- More Expression-bodied members: Allows constructors, parsers, properties to use expressions as body
- The Throw Expressions:throw can be used in an expression
C # 7.1 Features (Visual Studio version 15.3)
- Async main: In the Main method in async mode
- Default expressions: Introducing a new literal value default
- Reference assemblies:
- Inferred tuple element Names:
- Pattern-matching with generics:
C # 7.2 Features (Visual Studio version 15.5)
- Span and Ref-like types
- In Parameters and ReadOnly references
- REF Conditional
- Non-trailing named arguments
- Private protected Accessibility
- Digit separator after base specifier
C # 7.3 Features (Visual Studio version 15.7)
System.Enum
, System.Delegate
and unmanaged
constraints.
- Ref local RE-ASSIGNMENT:REF Locals and ref parameters can now is reassigned with the REF assignment operator (
= ref
).
- Stackalloc initializers:stack-allocated Arrays can now is initialized, e.g.
Span<int> x = stackalloc[] { 1, 2, 3 };
- Indexing movable fixed buffers:fixed buffers can be indexed into without first being pinned.
- Custom
fixed
statement:types that implement a suitable GetPinnableReference
can be used in a fixed
statement.
- Improved overload Candidates:some overload resolution candidates can be ruled out early, thus reducing ambiguities.
- Expression variables in initializers and queries:expression variables like and
out var
pattern variables is allowed in fie LD initializers, constructor initializers and LINQ queries.
- Tuple Comparison:tuples can now is compared with
==
and !=
.
- Attributes on backing Fields:allows Attributes on a auto-implemented property to
[field: …]
target its backing field.
C # 8.0 Features
- Default Interface Methods Defaults interface implementation
- Nullable Reference type Nullablereferencetypes non-null and controllable data types
- Recursive patterns Recursive mode
- Async streams Asynchronous Data flow
- Caller expression attribute calling method expressions property
- target-typed New
- Generic attributes Common Properties
- Ranges
- Default in Deconstruction
- Relax ordering of ref and partial modifiers
C # Language history version features (C # 1.0 to C # 8.0 rollup)