Jakie są poprawne numery wersji C#?

Jakie są poprawne numery wersji C#? Co wyszło kiedy? Dlaczego nie mogę znaleźć żadnych odpowiedzi na temat C# 3.5?

To pytanie ma przede wszystkim pomóc tym, którzy szukają odpowiedzi używając błędnego numeru wersji, np. C# 3.5. Nadzieja jest taka, że każdy, kto nie znajdzie odpowiedzi z błędnym numerem wersji, znajdzie to pytanie , a następnie ponownie wyszukuje właściwy numer wersji.

Author: Jon Skeet, 2008-10-29

12 answers

Historia wersji językowej C#:

Oto wersje C# znane w momencie pisania tego tekstu:

W odpowiedzi na pytanie OP:

Jakie są poprawne numery wersji C#? Co wyszło kiedy? Dlaczego nie mogę znaleźć odpowiedzi na temat C # 3.5?

Nie ma czegoś takiego jak C# 3.5 - przyczyną zamieszania jest to, że C # 3.0 jest obecny w.NET 3.5. Język i ramy są niezależnie od wersji-podobnie jak CLR, który jest w wersji 2.0 Dla. NET 2.0 do 3.5,. NET 4.0 do CLR 4.0, bez względu na dodatki service Pack. CLR w. NET 4.5 ma różne ulepszenia, ale wersjonowanie jest niejasne: w niektórych miejscach może być określane jako CLR 4.5 (ta strona MSDN używana do tego, na przykład, w ten sposób), ale Environment.Version property still reports 4.0.xxx.

[[27]} od 3 Maja 2017 roku zespół języka C # stworzył historię języka C# wersje i funkcje w repozytorium GitHub: funkcje dodane w wersjach językowych C# . Istnieje również strona , która śledzi nadchodzące i ostatnio zaimplementowane funkcje językowe .
 2966
Author: Jon Skeet,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-11-13 19:27:01

Jest to to samo, co większość odpowiedzi tutaj, ale tabelaryczne dla ułatwienia, i ma wersje Visual Studio i . NET dla kompletności.

[23]} Kwiecień 2019 2019 (v16.8)
Wersja C# VS Wersja . NET version Wersja CLR Data premiery
1.0 2002 1.0 1.0 luty 2002
1.2 2003 1.1 1.1 Kwiecień 2003
2.0 2005 2.0 2.0 listopad 2005
3.0 2.0 listopad 2006
3.0 2008 3.5 2.0 listopad 2007
4.0 2010 4.0 4 Apr 2010
5.0 2012 4.5 4 Sierpień 2012
5.0 2013 4.5.1 4 Październik 2013
4.5.2 4 Maj 2014
6.0 2015 4.6 4 Lipiec 2015
4.6.1 4 Listopad 2015
4.6.2 4 Sierpień 2016
7.0 2017 marzec 2017
4.7 4 Maj 2017
7.1 2017 (v15.3) Sierpień 2017
4.7.1 4 Październik 2017
7.2 2017 (v15.5) Grudzień 2017
4.7.2 4 kwiecień 2018
7.3 2017 (v15.7) Maj 2018
8.0 2019 4.8 4
9.05.0^ ^^ Listopad 2020

^ -. NET 5.0 nie jest nowszą wersją. NET framework, ale. NET Rdzeń 3. Począwszy od. NET 5.0, nie ma nowszych wersji. NET full framework.

^^ - nie ma osobnych wersji CLR (CoreCLR) dla.NET Core. cokolwiek jest wersją. NET Core jest wersją CoreCLR. Nie wspominając o tym.


Uwaga: rozwój. NET jest prawie niezależny od VS w dzisiejszych czasach, nie ma korelacji między wersjami każdej z nich. Więcej informacji można znaleźć w sekcji " . NET Framework versions and dependencies".

 358
Author: nawfal,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-12-09 12:47:40

Największym problemem w przypadku numerów wersji C#jest fakt, że nie jest on związany z wersją. NET Framework, co wydaje się być spowodowane zsynchronizowanymi wydaniami między Visual Studio i.NET Framework.

Wersja C# jest w rzeczywistości związana z kompilatorem, a nie z frameworkiem. Na przykład w Visual Studio 2008 można napisać C # 3.0 i docelowy. NET Framework 2.0, 3.0 i 3.5. Nomenklatura C # 3.0 opisuje wersję składni kodu i wspiera funkcje w taki sam sposób jak ANSI C89, C90, C99 opisują składnię kodu / funkcje dla C.

Spójrz na Mono, a zobaczysz, że Mono 2.0 (głównie zaimplementowana Wersja 2.0.NET Framework ze specyfikacji ECMA) obsługuje składnię i funkcje C# 3.0.

 307
Author: Bryan Rehbein,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-11-06 17:19:06
  • C # 1.0 with Visual Studio.NET

  • C # 2.0 with Visual Studio 2005

  • C# 3.0 with Visual Studio 2008

  • C# 4.0 z Visual Studio 2010

  • C # 5.0 z Visual Studio 2012

  • C # 6.0 z Visual Studio 2015

  • C # 7.0 z Visual Studio 2017

  • C # 8.0 z Visual Studio 2019

 199
Author: iTSrAVIE,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-02-12 14:52:25

WERSJA_____SPECYFIKACJA JĘZYKA______KOMPILATOR MICROSOFT

C# 1.0/1.2____Grudzień 2001 ?/2003?___________styczeń 2002 ?

C# 2.0_______Wrzesień 2005________________Listopad 2005 ?

C# 3.0_______Maj 2006_____________________Listopad 2006 ?

C# 4.0_______marzec 2009 (projekt)______________Kwiecień 2010 ?

C # 5.0; wydany z. NET 4.5 W Sierpień 2012

[10]} C # 6.0; wydany z. NET 4.6 2015 [10]} C # 7.0; wydany z. NET 4.7 2017 [10]}C# 8.0; wydany z. NET 4.8 2019
 88
Author: maxwellb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-02-13 12:36:56

Historia Wersji C#:

C # to prosty i wydajny obiektowo zorientowany język programowania opracowany przez firmę Microsoft.

C# ewoluował znacznie od pierwszego wydania w 2002 roku. C# został wprowadzony wraz z. NET Framework 1.0.

Poniższa tabela zawiera ważne funkcje wprowadzone w każdej wersji C#.

A najnowsza wersja C# jest dostępna w wersje C# .

1: Tutaj wpisz opis obrazka

 69
Author: Milan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-03-16 07:46:04

Podsumowałem większość wersji w tej tabeli. Brakuje tylko ASP.NET wersje podstawowe. Dodałem również różne wersje ASP.NET MVC.

Zauważ, że ASP.NET 5 został przemianowany na ASP.NET Core 1.0 i ASP.NET MVC 6 został przemianowany na ASP.NET Core MVC 1.0.0. Wierzę, że ta zmiana nastąpiła gdzieś około stycznia 2016.

Podałem datę premiery ASP.NET 5 RC1 w tabeli, ale jeszcze nie uwzględniłem ASP.NET core 1.0 i inne wersje core, ponieważ nie mogłem znaleźć dokładnych dat wydania. Więcej o datach premiery można przeczytać w ASP.NET Rdzeń tutaj: Kiedy jest ASP.NET Core 1.0 (ASP.NET 5 / vNext) planowana premiera?

Wersja

 57
Author: Mindless,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-11-06 17:31:23

Możesz sprawdzić najnowsze wersje C# tutaj Wersje C#

 54
Author: Israel Ocbina,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-10-30 19:58:33

Porównując artykuły MSDN "Co nowego w języku C# 2.0 i kompilatorze" i "Co nowego w Visual C# 2005", można wywnioskować, że "C# major_version.minor_version " jest ukuty zgodnie z numeracją wersji kompilatora.

[1]}Istnieje C# 1.2 odpowiadający.NET 1.1 I VS 2003, a także nazwany Visual C#. Net 2003.

Ale dalej Microsoft zatrzymał się, aby zwiększyć wersję podrzędną (po kropce) numery lub mieć inne niż zero, 0. Należy jednak zauważyć, że C# odpowiadający. NET 3.5 jest nazwany w msdn.microsoft.com jako "Visual C# 2008 Service Pack 1" .

Istnieją dwie równoległe nazwy: według numeracji wersji. NET/kompilatora oraz numeracji Visual Studio.

C # 2.0 jest synonimem Visual C# 2005

C # 3.0 odpowiada (lub, bardziej poprawnie, może kierować) do:

 40
Author: Gennady Vanin Геннадий Ванин,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-11-06 17:22:41

C # 1.0-Visual Studio. NET 2002

Classes
Structs
Interfaces
Events
Properties
Delegates
Expressions
Statements
Attributes
Literals

C # 1.2-Visual Studio. NET 2003

Dispose in foreach
foreach over string specialization
C# 2 - 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-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-Visual Studio 2010

Dynamic binding
Named and optional arguments
Co- and Contra-variance for generic delegates and interfaces
Embedded interop types ("NoPIA")

C # 5-Visual Studio 2012

    Asynchronous methods
    Caller info attributes

C # 6-Visual Studio 2015

Draft Specification online
Compiler-as-a-service (Roslyn)
Import of static type members into namespace
Exception filters
Await in catch/finally blocks
Auto property initializers
Default values for getter-only properties
Expression-bodied members
Null propagator (null-conditional operator, succinct null checking)
String interpolation
nameof operator
Dictionary initializer

C# 7.0 - Visual Studio 2017

Out variables
Pattern matching
Tuples
Deconstruction
Discards
Local Functions
Binary Literals
Digit Separators
Ref returns and locals
Generalized async return types
More expression-bodied members
Throw expressions

C# 7.1 - Visual Studio 2017 Wersja 15.3

Async main
Default expressions
Reference assemblies
Inferred tuple element names
Pattern-matching with generics

C# 7.2 - Visual Studio 2017 Wersja 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-Visual Studio 2017 Wersja 15.7

System.Enum, System.Delegate and unmanaged constraints.
Ref local re-assignment: Ref locals and ref parameters can now be reassigned with the ref assignment operator (= ref).
Stackalloc initializers: Stack-allocated arrays can now be 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 out var and pattern variables are allowed in field initializers, constructor initializers and LINQ queries.
Tuple comparison: Tuples can now be compared with == and !=.
Attributes on backing fields: Allows [field: …] attributes on an auto-implemented property to target its backing field.

C # 8.0 -. NET Core 3.0 i Visual Studio 2019 wersja 16.3

Nullable reference types: express nullability intent on reference types with ?, notnull constraint and annotations attributes in APIs, the compiler will use those to try and detect possible null values being dereferenced or passed to unsuitable APIs.
Default interface members: interfaces can now have members with default implementations, as well as static/private/protected/internal members except for state (ie. no fields).
Recursive patterns: positional and property patterns allow testing deeper into an object, and switch expressions allow for testing multiple patterns and producing corresponding results in a compact fashion.
Async streams: await foreach and await using allow for asynchronous enumeration and disposal of IAsyncEnumerable<T> collections and IAsyncDisposable resources, and async-iterator methods allow convenient implementation of such asynchronous streams.
Enhanced using: a using declaration is added with an implicit scope and using statements and declarations allow disposal of ref structs using a pattern.
Ranges and indexes: the i..j syntax allows constructing System.Range instances, the ^k syntax allows constructing System.Index instances, and those can be used to index/slice collections.
Null-coalescing assignment: ??= allows conditionally assigning when the value is null.
Static local functions: local functions modified with static cannot capture this or local variables, and local function parameters now shadow locals in parent scopes.
Unmanaged generic structs: generic struct types that only have unmanaged fields are now considered unmanaged (ie. they satisfy the unmanaged constraint).
Readonly members: individual members can now be marked as readonly to indicate and enforce that they do not modify instance state.
Stackalloc in nested contexts: stackalloc expressions are now allowed in more expression contexts.
Alternative interpolated verbatim strings: @$"..." strings are recognized as interpolated verbatim strings just like $@"...".
Obsolete on property accessors: property accessors can now be individually marked as obsolete.
Permit t is null on unconstrained type parameter

[źródło] : https://github.com/dotnet/csharplang/blob/master/Language-Version-History.md

 12
Author: sayah imad,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2019-11-24 22:12:41
Version     .NET Framework  Visual Studio   Important Features
C# 1.0  .NET Framework 1.0/1.1  Visual Studio .NET 2002     

    Basic features

C# 2.0  .NET Framework 2.0  Visual Studio 2005  

    Generics
    Partial types
    Anonymous methods
    Iterators
    Nullable types
    Private setters (properties)
    Method group conversions (delegates)
    Covariance and Contra-variance
    Static classes

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 expressions
    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 Expression
    Primary constructor
    Await in catch block
    Exception Filter
    String Interpolation

C# 7.0  .NET Core 2.0   Visual Studio 2017  

    out variables
    Tuples
    Discards
    Pattern Matching
    Local functions
    Generalized async return types
    Numeric literal syntax improvements
C# 8.0  .NET Core 3.0   Visual Studio 2019  

    
    Readonly members
    Default interface methods
    Pattern matching enhancements:
        Switch expressions
        Property patterns
        Tuple patterns
        Positional patterns
    Using declarations
    Static local functions
    Disposable ref structs
    Nullable reference types
    Asynchronous streams
    Asynchronous disposable
    Indices and ranges
    Null-coalescing assignment
    Unmanaged constructed types
    Stackalloc in nested expressions
    Enhancement of interpolated verbatim strings
 6
Author: user12275552,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-08-08 15:01:04

C # 8.0 to najnowsza wersja c#.it jest obsługiwana tylko na. Net Core 3.X i nowsze wersje. Wiele najnowszych funkcji wymaga bibliotek i funkcji runtime wprowadzonych w. NET Core 3.x

Poniższa tabela zawiera listę docelowego frameworka z wersją i ich domyślną wersją C#.

Wersja językowa C# z docelowym frameworkiem

Source-C# language versioning

 3
Author: Shivam Mishra,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-03-02 11:48:35