I was always curious how exactly assemblies compiled for .NET 2.0 are used when you reference from asseblies compiled for .NET 4.0. Somehow, I could not find "an official" answer to this question, and was too lazy to check myself. Thankfully, I have a young collegue who was as curious as I am but not so lazy.
So, here is an experiment.
Exe A,
- target platform 4.0
- target platform 2.0,
- referenced by exe A.
- references System.dll, .NET 2.0.
Question, will System.dll 2.0 will be loaded when we run A, or System.dll from 4.0?
The answer - System.dll from 4.0.