C# feature & Update version by version

02Nov

C# List features

C# 1.0

Microsoft released the first version of C# with Visual Studio 2002. Use of Managed Code was introduced with this version. C# 1.0 was the first language that developer adopted to build .NET applications.

C# 2.0

Microsoft released the second version of C# language with Visual Studio 2005. C# 2.0 has introduced few new features in this edition which helped the developers to code their applications in more generic way. Here are the new features that were introduced with C# 2.0:

C# 3.0

Visual Studio 2008 came with C# version 3.0 and it has a bunch of new features. It was the life-changing the language for Microsoft platform developers to build their applications. Till now, many developers are still using this version to build their apps. The new features that came with C# 3.0 were:

C# 7.1

C# 7.1 is the new version (at the time of updating this article) which again adds a couple of new features to the C# language:

Asynchronous Main – Main could be void or int and contain arguments as a string array.

Default Literal – Visual Basic and C# have similar features, but there are certain differences in the languages, i.e. C# has null, while VB.NET has Nothing.

That’s all as per this post is concerned. We will update this list as soon as new version is out in the market.

C# version history in tabular format for quick view:

Version

Date

.NET Framework

Visual Studio

C# 1.0

Jan-02

.NET Framework 1.0

Visual Studio .NET 2002

C# 1.1/1.2

Apr-03

.NET Framework 1.1

Visual Studio .NET 2003

C# 2.0

Nov-05

.NET Framework 2.0

Visual Studio .NET 2005

C# 3.0

Nov-07

.NET Framework 2.0 (Except LINQ),.NET Framework 3.0 (Except LINQ),

.NET Framework 3.5

Visual Studio .NET 2008,Visual Studio .NET 2010

C# 4.0

Apr-10

.NET Framework 4.0

Visual Studio .NET 2010

C# 5.0

Aug-12

.NET Framework 4.5

Visual Studio .NET 2012/2013

C# 6.0

Jul-15

.NET Framework 4.6

Visual Studio .NET 2015

C# 7.0

Mar-17

.NET Framework 4.6.2

Visual Studio .NET 2017

Expected New Features In C# 8.0

Recently in channel 9, Mads Torgersen demonstrated the first four features of C# 8. Below is the brief description of those new features in C# 8.0. This is going to be the next major release after C# 7.0

Expected New Features In C# 8.0

C# 8.0 Previewed: below are the 4 features which Mads discussed in his recent talk on channel 9.

1. Nullable Reference Types

With C# 8.0, references type would not be nullable by default. Assigning null to a non-nullable reference type will be a compiler warning, similarly reading from a nullable type would also be a compiler warning unless the variable in question was explicitly checked for null ahead of time.

2. Async Streams

Async streams are the asynchronous equivalent of IEnumerable. The syntax for the same is:

3. Default Interface Implementations

A default interfaces programming capability, so interfaces can evolve via virtual extension methods. An API author could add methods to an interface in future versions without breaking source or binary compatibility. This feature already is available in programming languages such as Java.

The most cited use case for this feature is the ability to add a Count property to IEnumerable<T>. The idea is that instead of using the Enumerable.Count extension method, developers can get Count for free and optionally override it if they can provide a more efficient alternative.

Extension properties were the long-time pending feature. Under the new design, there is a new top-level construct called an extension. For example, if you want to create extension methods and properties for a Student class you would write:

extension StudentExt extends Student {

//methods and properties go here

}

In this video, Mads Torgersen talks about some of the planned features of C# 8.0.