Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# C的正确版本号是什么?_C#_.net_Visual Studio_.net Framework Version_Compiler Version - Fatal编程技术网

C# C的正确版本号是什么?

C# C的正确版本号是什么?,c#,.net,visual-studio,.net-framework-version,compiler-version,C#,.net,Visual Studio,.net Framework Version,Compiler Version,C的正确版本号是什么?什么时候出来的?为什么我找不到关于C#3.5的任何答案 此问题主要用于帮助那些使用错误版本号(例如C#3.5搜索答案的人。希望任何未能找到错误版本号的答案的人都能找到这个问题,然后用正确的版本号再次搜索。C#语言版本历史: 以下是撰写本文时已知的情况: C#1.0与.NET 1.0和VS2002一起发布(2002年1月) C#1.2(很奇怪);与.NET1.1和VS2003一起发布(2003年4月)。在IEnumerators上调用Dispose的第一个版本,它实现了ID

C的正确版本号是什么?什么时候出来的?为什么我找不到关于C#3.5的任何答案

此问题主要用于帮助那些使用错误版本号(例如C#3.5搜索答案的人。希望任何未能找到错误版本号的答案的人都能找到这个问题,然后用正确的版本号再次搜索。

C#语言版本历史: 以下是撰写本文时已知的情况:

  • C#1.0与.NET 1.0和VS2002一起发布(2002年1月)
  • C#1.2(很奇怪);与.NET1.1和VS2003一起发布(2003年4月)。在
    IEnumerator
    s上调用
    Dispose
    的第一个版本,它实现了
    IDisposable
    。其他一些小功能
  • C#2.0与.NET 2.0和VS2005一起发布(2005年11月)。主要新特性:泛型、匿名方法、可空类型、迭代器块
  • C#3.0与.NET 3.5和VS2008一起发布(2007年11月)。主要新功能:lambda表达式、扩展方法、表达式树、匿名类型、隐式类型(
    var
    ),查询表达式
  • C#4.0与.NET 4和VS2010一起发布(2010年4月)。主要新特性:后期绑定(
    动态
    ),委托和接口通用变量,更多COM支持,命名参数,元组数据类型和可选参数
  • C#5.0与.NET 4.5和VS2012一起发布(2012年8月):异步编程,调用方信息属性。零钱:
  • C#6.0与.NET 4.6和VS2015一起发布(2015年7月)。执行人:自动实现属性的初始值设定项,使用指令导入静态成员、异常筛选器、元素初始值设定项、
    catch
    中的
    wait
    最终
    ,扩展名
    在集合初始值设定项中添加
    方法
  • C#7.0与.NET 4.7和VS2017一起发布(2017年3月)。主要:,(包括基于模式的开关语句),和
  • C#7.1与VS2017 v15.3一起发布(2017年8月)新功能:、
  • C#7.2与VS2017 v15.5一起发布(2017年11月)新功能:
  • C#7.3与VS2017 v15.7一起发布(2018年5月)。新功能:<代码>参考重新分配。不安全的改进:
    stackalloc
    初始化、未固定索引的
    fixed
    缓冲区、自定义
    fixed
    语句。改进的重载分辨率。初始值设定项和查询中的表达式变量<代码>=和
    =为元组定义。自动属性的备份字段现在可以通过属性作为目标
  • C#8.0与.Net Core 3.0和VS2019 v16.3一起发布(2019年9月)。少校:,,和
  • C#9.0与VS2019 v16.8一起发布(2020年11月)。主修:、数据类、位置记录(简单类型模式、关系模式、逻辑模式)、改进的目标类型(目标类型<代码>新的<代码>表达式、目标类型<代码>和<代码>和<代码>?<代码>),协变返回。次要功能:放宽
    ref
    partial
    修饰符的顺序,参数null检查,lambda丢弃参数,本机
    int
    s,本地函数属性,函数指针,静态lambda,扩展
    GetEnumerator
    ,模块初始值设定项,扩展partial
针对OP的问题: C的正确版本号是什么?什么时候出来的?为什么我找不到关于C#3.5的答案

没有像C#3.5这样的东西——这里引起混淆的原因是C#3.0出现在.NET3.5中。但是,该语言和框架的版本是独立的,CLR的版本也是独立的,在.NET 2.0到3.5版本中,CLR的版本是2.0,.NET 4引入了CLR 4.0,尽管有service Pack。NET 4.5中的CLR有各种改进,但版本控制还不清楚:在某些地方,它可能被称为CLR 4.5(例如,用来这样称呼它),但该属性仍然报告4.0.xxx


截至2017年5月3日,C语言团队在其GitHub存储库中创建了C版本和功能的历史记录:。还有一个问题。

在处理C#的版本号时,最大的问题是它没有绑定到.NET Framework的版本,这似乎是由于Visual Studio和.NET Framework之间的同步发布

C#的版本实际上绑定到编译器,而不是框架。例如,在VisualStudio2008中,您可以编写C#3.0和目标.NET Framework 2.0、3.0和3.5。C#3.0术语描述代码语法的版本和支持的特性的方式与描述C的代码语法/特性的方式相同

看一看,您会发现Mono 2.0(主要是ECMA规范中实现的.NET Framework 2.0版)支持C#3.0语法和功能

语言规范 微软编译器 #/ 2001年12月?/2003年? 2002年1月? C#2.0 2005年11月? C#3.0 2006年11月? C#4.0 2010年4月? C#5.0 2012年8月与.NET 4.5一起发布 C#6.0 与.NET 4.6 2015一起发布 C#7.0 2017年与.NET 4.7一起发布 C#8.0 2019年与.NET 4.8一起发布
  • C#1.0使用Visual Studio.NET

  • 使用Visual Studio 2005的C#2.0

  • 使用Visual Studio 2008的C#3.0

  • C#4.0使用Visual Studio 2010

  • 使用Visual Studio 2012的C#5.0

  • C#6.0与Visual Studio 2015

  • C#7.0与Visual Studio 2017

  • C#8.0
    Classes
    Structs
    Interfaces
    Events
    Properties
    Delegates
    Expressions
    Statements
    Attributes
    Literals
    
    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
    
    Implicitly typed local variables
    Object and collection initializers
    Auto-Implemented properties
    Anonymous types
    Extension methods
    Query expressions
    Lambda expression
    Expression trees
    Partial methods
    
    Dynamic binding
    Named and optional arguments
    Co- and Contra-variance for generic delegates and interfaces
    Embedded interop types ("NoPIA")
    
        Asynchronous methods
        Caller info attributes
    
    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
    
    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
    
    Async main
    Default expressions
    Reference assemblies
    Inferred tuple element names
    Pattern-matching with generics
    
    Span and ref-like types
    In parameters and readonly references
    Ref conditional
    Non-trailing named arguments
    Private protected accessibility
    Digit separator after base specifier
    
    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.
    
    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
    
    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