문제

All,

I have few questions how program's assemblies bind to the underlying CLR version.

1) Is it possible to build/run .net 2.0 app that references .net 4.0 assemblies (which use CLR 4.0)? If so, how?

2) My understanding of the .net framework tells me that referencing .net 2.0 asssemblies in .net 4.0 app (that is build against CLR 4.0) is OK. In this scenario, the app is build and runs under CLR 4.0 but what happens when the referenced assembly (which was build in .net 2.0/3.0/3.5 (CLR 2.0)) is loaded and executes? Does the app load CLR 2.0 now? Or does the code execute under CLR 4.0 which was designed to run older assemblies?

Looking forward to your responses. Feel free to elaborate.

도움이 되었습니까?

해결책

1) No, forwards compatibility is not supported and the application will not compile.

2) Code executes under CLR 4.0 which was designed to run older assemblies. It is backwards compatible for that very reason.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top