tags:

views:

74

answers:

2

Can you use a .NET 4.0 dll in a 3.5 project?

+2  A: 

Nope. You can use a .Net 3.5 assembly in a 4.0 project, but not the other way around.

Chris Lively
+3  A: 

No you can't. An assembly compiled against .NET 4.0 can be loaded only by the CLR 4.0. On the other hand the CLR 4.0 can load assemblies compiled against .NET 3.5.

Darin Dimitrov
CLR 4.0 loading a 3.5 assembly surprised and confused me the other day. Scratched my head over that one for a bit.
Jim Mischel
@Jim, why? If this wasn't possible I cannot even imagine ever migrating to .NET 4.0. Microsoft have always done a good job at keeping backwards compatibility when releasing new versions of the framework/CLR.
Darin Dimitrov
I don't know why it surprised me. In retrospect, it shouldn't have. But for some reason at the time I didn't expect it.
Jim Mischel