Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which new C#/VB features require .net Framework 4?

I remember reading in passing that some of the new language features in C# and VB that are available in VS2010 are backwards compatible with earlier versions of the framework, but that others are not. I'm pretty sure this was in reference to the new property syntax in VB.

Which new features are language features vs which ones are framework specific?

like image 438
Barry Avatar asked Apr 30 '10 12:04

Barry


3 Answers

I would suggest reading What's New in .NET 4.0 for a comprehensive answer, rather than for bits and bobs people can remember and come up with on here.

There is a definitive list on that page.

like image 84
NibblyPig Avatar answered Sep 17 '22 23:09

NibblyPig


Co- and contra-variance doesn't require .NET framework 4, but the relevant interfaces and delegate types have been updated to support variance. E.g. IEnumerable<T> is now IEnumerable<out T>.

The new dynamic keyword is tied to the IDynamicMetaObjectProvider interface which is used to implement dynamic binding. You could say that dynamic binding requires the DLR which is part of the new runtime and framework.

like image 34
Brian Rasmussen Avatar answered Sep 18 '22 23:09

Brian Rasmussen


The dynamic type is new for C# 4, it works with the new Dynamic Language Runtime extension to the CLR.

like image 26
Richard Ev Avatar answered Sep 20 '22 23:09

Richard Ev