I have 2 Visual Studio 2010 solutions and I need to share a project between them. However, one of the solutions needs to build against .Net 3.5 and the other against 4.0.
If I change the Targeted Framework in one of the solutions, obviously this updates the project in the other and I can no longer compile the solution. Is there a way I can set the project to compile against different versions depending on which solution I’m using?
A solution doesn’t build against a particular framework version – a project does. So it sounds like you should make your shared project target .NET 3.5, and you can still add a reference to this from a 4.0 project in the solution which requires that. So you’ll have: