Does the CLR when it attempts to load an assembly, pay any attention to the TargetFramework attribute?
Can an assembly with TargetFramework attribute X load another assembly that has a TargetFramework attribute > X ?
From perusing the web and the MS reference source, it seems that this attribute if informational only. No part of the CLR or .Net itself seems to ever look at this attribute if it is present.
It seems that it's useful for manually investigating deployment problems and so on.
However Visual Studio does leverage it it seems. When we have a project (exe or class lib etc) built against version 4 (say) of .Net Framework and we try to add a ref to an assembly which has a TargetFremwork attribute say 4.5, then we will get build warnings about version conflicts between these assembly being referenced and the project making the reference.
Visual Studio also flags the reference with a yellow warning icon.
It seems you are allowed to add the reference using Add Reference even though this will lead to a build error.
Any more info about this is appreciated.
Thanks