Difference between CLR 2.0 and CLR 4.0

.net-4.0, c#-4.0, clr

Solution

One new CLR thing that I know about is a form of structural typing for interfaces, structs and delegates for the sake of NoPIA support - basically, it lets runtime treat distinct types with equivalent definitions as if they were the same - so if two assemblies `A` and `B` each have a COM-imported interface `IFoo` declared in them, with the same IID and same members, runtime will treat them as equivalent types; so if there's an instance some class `Foo` implementing `[A]IFoo`, you can cast it to `[B]IFoo`, and the cast will work.

One other thing is the ability to host several CLR versions side-by-side in a single process. You cannot host 1.x and 2.0 in one process, for example, but you can host 2.0 and 4.0. The main benefit for this is the ability to load plugins written for either CLR version concurrently.

One minor bit is that a few more exceptions have become uncatchable like `StackOverflowException` was in 2.0 - you cannot catch `AccessViolationException` anymore, for example.

Also, here is a PowerPoint presentation on CLR 4.0 from PDC 2008. It might be a bit dated now, but most stuff that's mentioned there seems to be in the betas.

Problem

I have read countless blogs, posts and StackOverflow questions about the new features of C# 4.0. Even new WPF 4.0 features have started to come out in the open. What I could not find and will like to know: - What are the major changes to CLR 4.0 from a C#/WPF developer perspective? - What are the major changes to CLR 4.0 as a whole? I think, internally, most changes are for the new dynamic languages and parallel programming. But are there any other major improvements? Because language improvements are just that, language improvements. You just need the new compiler and those features can be used with a lower version of .Net, apart from version 1.0/1.1 (at least most of them can be used). And if the above features are the only ones, only for these features the version is changed to 4.0, which I think is 4.0 because of being based on .Net 4.0 version (i.e. after 1.0/1.1, 2.0 & 3.0/3.5). Is the version increment justified? Edited: As Pavel Minaev pointed out in the comments, even those two features are CLR independent. There were speed and other improvements in 3.0 and 3.5 also. So why the version increment?

Original source

Related problems