C# Versions History

C# Versions History

The C# programming language has been implemented by Anders Hejlsberj, an employee of Microsoft. The C# programming language's initial release is in 2002 with .NET Framework 1.0, and it’s more like Java programming.

C# is the programming language, and .NET is the runtime support environment. C# has evolved much since its first release in 2002 and was introduced with .NET Framework 1.0 .

One thing you should be aware that while the C# language and the C# compiler are separate from .Net framework, they still depend on it.

The biggest problem when dealing with C#'s version numbers is the fact that it is not tied to a version of the .NET Framework , which it appears to be due to the synchronized releases between Visual Studio and the .NET Framework.

The C# language relies on types and methods in what the C# specification defines as a standard library for some of the features. The .NET platform delivers those types and methods in a number of packages.

C# is an object-oriented language. It is very simple and powerful.

In this tutorial, we will discuss the different versions and Features.

History of C# Versions

C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 1.0Visual Studio 20021.01.02002
C# 1.2Visual Studio 20031.11.12003
C# 2.0Visual Studio 20052.02.02005
C# 3.0Visual Studio 20083.52.02007
C# 4.0Visual Studio 20104.042010
C# 5.0Visual Studio 20124.542013
C# 6.0Visual Studio 20154.642015
C# 7.0Visual Studio 20174.742017
C# 8.0Visual Studio 20194.842019

C# Versions and Features

01. C# Version 1.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 1.0Visual Studio 20021.01.02002

This version is like java. Its lack in the async capabilities and some functionalities. The major features of this release are below:

  1. Classes: It is a blueprint that is used to create the objects.
  2. Structs: In Struct, we can store different data types under a single variable. We can use user-defined datatype in structs. We have to use the struct keyword to define this.
  3. Literals: It is a value used by the variable. This is like a constant value.
  4. Delegates: This is like a pointer. It is a reference type variable which holds the other methods.
  5. Interfaces
  6. Events
  7. Properties
  8. Expressions
  9. Statements
  10. Attributes
     
02. C# Version 1.2
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 1.2Visual Studio 20031.11.12003

In this version, some enhancement has been done. They added for each loop in this version which will execute each block until an expression gets false. The features of this release are:

  1. Dispose in foreach
  2. foreach over string specialization
03. C# Version 2.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 2.0Visual Studio 20052.02.02005

In this version, they have added below advance features:

  1. Generics: Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters.
  2. Partial types
  3. Anonymous methods: This is a blank method. This is defined using the keyword delegate.
  4. Iterators
  5. Nullable types: Before this release, we can not define a variable as null. So this release overcomes this.
  6. Getter/setter separate accessibility: We can use a getter setter for getting and setting the values.
  7. Method group conversions (delegates)
  8. Static classes
  9. Delegate inference

04. C# Version 3.0

C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 3.0Visual Studio 20083.52.02007

This version made C# as a formidable programming language.

  1. Implicitly typed local variables
  2. Object and collection initializers: With the help of this we can access any field without invoking constructor.
  3. Auto-Implemented properties
  4. Anonymous types
  5. Extension methods
  6. Query expressions
  7. Lambda expression
  8. Expression trees
  9. Partial methods: As the name suggests its signature and implementations defined separately.
  10. Var: we can define any variable by using the keyword var.

05. C# Version 4.0

C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 4.0Visual Studio 20104.042010

The version introduced some interesting features:

  • Dynamic binding
  • Named and optional arguments
  • Co- and Contra-variance for generic delegates and interfaces
  • Embedded interop types ("NoPIA")
06. C# Version 5.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 5.0Visual Studio 20124.542013

In this version, they added two new models for asynchronous programming.

  • Asynchronous methods
  • Caller info attributes

[async and await]: With these, we easily retrieve information about the context. This is very helpful with long-running operations. In this async enables the keyword await. With the help of await keyword, all the things get asynchronous. So it runs synchronously till the keyword await.

07. C# Version 6.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 6.0Visual Studio 20154.642015

This version included below functionalities:

  • 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
08. C# Version 7.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 7.0Visual Studio 20174.742017

This version has below advantages:

  • 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
09. C# Version 8.0
C# VersionsVisual Studio    .NET FrameworkCLR versionYear
C# 8.0Visual Studio 20194.842019

This version has below advantages:

  • Nullable reference types
  • Default interface members
  • Recursive patterns
  • Async streams
  • Enhanced using
  • Ranges and indexes
  • Null-coalescing assignment
  • Static local functions
  • Unmanaged generic structs
  • Readonly members
  • Stackalloc in nested contexts
  • Alternative interpolated verbatim strings
  • Obsolete on property accessors

This is a guide to C# Versions. Here we discuss the basic concept, various types of C# Versions.

One thing you should be aware that the C# compilers that are part of the Visual Studio 2017 installation or earlier .NET Core SDK versions target C# 7.0 by default.