C# and .Net Framework Features by Version Quick Reference


With few exceptions, developers like using the latest tools and technologies, but are often constrained by the development or production environment. There are many reasons organizations are unwilling or slow to adopt new technology, and these can range from financial to cultural or political. A good developer can survey the landscape, put the success of the project and customer above his own interests, and know when to campaign for change and when to accept constraints. This article will help developers make informed decisions by providing a quick reference of the features that were introduced in each version of the C# language and the .Net Framework.


There are two key questions a .Net application developer must answer at the beginning of any project because of the potential impacts to the development approach and application architecture.



  • What version of Visual Studio (or other tools) is available to me?

  • What version of the .Net Framework is (or can be) installed on the target machine(s)?

We typically think of .Net versioning in terms of the Framework, "this will be a 2.0 development project," but it is important to understand there are actually three independently versioned components to consider:



  • Language (such as C#)

  • Common Language Runtime (CLR)

  • .Net Framework

The following matrix shows the relationship between component versions:






























C# Version


CLR Version


Framework Version


1.0


1.0


1.0


1.1


1.1


1.1


2.0


2.0


2.0


3.0

   

3.0


2.0 (updated)


3.5


Before the introduction of .Net 3.0, these components were released as a logical unit, but things got out of sync when the 3.0 Framework did not include a new version of C# or the CLR. For this reason, some think.Net 3.0 should have been released as ".Net 2.5." So what is the 3.0 Framework then? It's a set of libraries (formerly WinFX) that depend on and extend the .Net 2.0 Framework and provide revolutionary technologies such as Windows Communication Foundation (WCF), Windows Workflow Foundation (WF) and Windows Presentation Foundation (WPF).


Developers can exploit the.Net version synchronicity issue by utilizing 3.0 and 3.5 Framework features on a machine that only has the .Net 2.0 Framework installed. Although I am not advocating this technique (especially to circumvent configuration or security controls), it can be accomplished by referencing libraries such as System.Core and using the copy local feature of Visual Studio to deploy selective Framework assemblies with your application without updating the Framework on the target machine. An additional point that should be evidenced from this technique is that language enhancements such as LINQ are actually "syntactic sugar" that can be written using only C# 2.0 code.


The following matrix identifies in which C# version a given significant feature was introduced:



























































































































































 

C# Version


Feature


1.0


"Cool"


1.1


2.0


"C# 2005"


3.0


"C# 2008"


Generics

   

X

 

Aliases

   

X

 

Static classes

   

X

 

Asymmetric Property Accessors

   

X

 

Anonymous Methods

   

X

 

Iterators

   

X

 

Partial Types

   

X

 

Nullable Types

   

X

 

Delegate Inference

   

X

 

Covariance and Contravariance

   

X

 

Captured Variables

   

X

 

Friend Assemblies

   

X

 

#pragma warning

   

X

 

Lambda Expressions

     

X


Extension Methods

     

X


Implicitly Typed Local Variables

     

X


Implicitly Typed Arrays

     

X


LINQ Query Expressions

     

X


Anonymous Types

     

X


Object and Collection Initializers

     

X


Auto-Implemented Properties

     

X


Partial Methods

     

X


Expression Trees

     

X


The following matrix indentifies in which Framework version a given significant feature was introduced:
























































































































































 

Framework Version


Feature


1.0


1.1


2.0


3.0


3.5


Side-by-Side Execution

 

X

     

Asp.Net Mobile Controls

 

X

     

IPv6 Support

 

X

     

64-Bit Platform Support

   

X

   

C# Edit and Continue Debugging

   

X

   

Click-Once Deployment

   

X

   

Strongly-Typed Application Settings

   

X

   

Windows Workflow Foundation

     

X

 

Windows Presentation Foundation

     

X

 

Windows Communication Foundation

     

X

 

Windows Cardspace

     

X

 

Microsoft AJAX Library

       

X


Add-In and Extensibility

       

X


Peer-To-Peer Networking

       

X


LINQ

       

X


HashSet Collection

       

X


Windows Forms Support for Asp.Net Membership

       

X


Suite B Cryptographic Support

       

X


Durable Services

       

X


It's not always possible to use the latest tools and technologies. In these situations, it's important for both the developer and the customer to understand what features are affected by these constraints. I hope this article will help with making an informed decision.


References:


Comments (6)

  1. C# and .NET Framework Features By Version

  2. Lucas says:

    Hi,

    Good post! Many developers are not aware of the different component versions. I think it is important to note that the language version is tied to the compiler version. As you mentioned, many of the new C# 3.0 features can be used when targetting the .NET 2.0 runtime and libraries, because the compiler emits code that works in the 2.0 runtime. All you need is to use the new compiler (VS2008).

    Even more of the new features can be used by implementing some of the classes and methods introduced in the new 3.5 assemblies. For example, by simply defining the System.Runtime.CompilerServices.ExtensionAttribute class, you can use extension methods in 2.0! The LinqBridge library by Albahari implements this attribute, the LINQ to Objects extension methods, and the various Func<> and Action<> delegates. It easily lets you use LINQ to Objects when targetting Framework 2.0.

  3. Charlotte says:

    What does CLR 2.0 "updated" mean with regard to .Net 3.5?  The post implies that I can run against .Net 3.5 assemblies on the same CLR as is used to run .Net 2.0 assemblies, but the table impies otherwise.  Is an update to the CLR required to run .Net 3.5 assemblies?  

  4. fractalnavel says:

    Professional ASP.NET MVC 1.0; Chapter 1: Nerd Dinner &quot;…walks through how to build a … complete

  5. K.Niveditha says:

    Can you give the fetures of C# 1.0

  6. hari says:

    in 1st set linq expression is in 3.0 but in 2nd set linq is in 3.5.. pl let me know which version it belongs

Skip to main content