1

I have a windows-form application which consists of three sub projects.

Project A - Classes
Project B - Classes
Project C – view (win forms)

When I try to add reference to of project B to project C it adds the reference fine. But when I build the project is comes with the error message saying that I am missing the reference to the Project B.

But later I found that Project C was set to target framework - .net framework 4 client profile and project B .net framework 4. When I changed the target framework to .net framework 4 in project c it all started work fine. What is the reason behind that?

Is it necessary that all projects needs to be in same target framework if they reference each other?

Thanks

huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99
  • possible duplicate of [Can not reference other projects](http://stackoverflow.com/questions/6562013/can-not-reference-other-projects) – Hans Passant May 08 '12 at 17:17

1 Answers1

1

According to MSDN:

"If you create a project that targets an earlier version of the .NET Framework, you cannot set a reference in that project to a project or assembly that targets the .NET Framework 4 Client Profile or .NET Framework version 4."

ssis_ssiSucks
  • 1,476
  • 1
  • 12
  • 11
  • yes, it says **that targets an earlier version of the .NET Framework**. The problem is both project are in .net framework 4. Difference is .net framework 4 and .net framework 4 client profile. – huMpty duMpty May 08 '12 at 16:23
  • see [this](http://msdn.microsoft.com/en-us/library/cc656912.aspx): "If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile" (also, http://msdn.microsoft.com/en-us/library/cc668079.aspx) – ssis_ssiSucks May 08 '12 at 16:56