views:

189

answers:

2

What exactly does the .NET 4.0 runtime do if a .NET 4.0 executable contains a reference to a .NET 2.0 assembly?

Is the .NET 2.0 assembly run with the .NET 4.0 runtime (in other words, .NET 4.0 must be 100% API-compatible to .NET 2.0) or does the process somehow host the .NET 2.0 runtime and some magic happens to make the .NET 2.0 types transparently accessible to my .NET 4.0-based code?

+1  A: 

They say it should work fine. Check out this.

m0s
Thanks. That sounds like the code will actually be executed by the .NET 4.0 CLR if loaded by a .NET 4.0 application. Still looking for some solid, official statement about this on MSDN, but haven't unearthed it yet.
Cygon
I'm tagging this as the answer because it lead me to the most useful information about the subject. When a .NET 4.0 application loads a .NET 2.0 assembly, it is indeed run within the .NET 4.0 CLR. There are even subtle differences (most important the security model) than can make .NET 2.0 assemblies fail to work without additional tweaks to the app.config file (log4net being one of those problem assemblies.)
Cygon
A: 

The same thing that happens when you type "google" into Google.