Why does adding a reference to project targeting .NET Framework 4.0 fail?

Posted by Malcolm Post on Stack Overflow See other posts from Stack Overflow or by Malcolm Post
Published on 2010-04-01T03:34:24Z Indexed on 2010/04/01 3:43 UTC
Read the original article Hit count: 253

We have two projects that are both class libraries. Project 1 is a VS 2008 project and targets the .NET Framework 3.5. Project 2 is a VS 2010 (release candidate) project that targets the .NET Framework 4.0. When I try to add a reference to Project 2 in Project 1, it fails with a less than informative error message. I know that if I change the target Framework for Project 2 to 3.5, then adding the reference will work. My question is, if I don't change the target frameworks, but convert Project 1 to VS 2010, will the referencing work? Stated another way, is there some inherent incompatiblity between class libraries targeting different framework versions, or is it failing for me because VS 2008 doesn't know about the 4.0 framework?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about .net-4.0