What happens when .NET 4.0 references a .NET 2.0 a

2019-01-26 03:45发布

问题:

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:

They say it should work fine. Check out this.