views:

33

answers:

2

What is the best practice for developing a shared class library in Visual Studio 2010 to be used by a .NET 3.5 app and a 4.0 app?

I could do it with separate project/solution files, one for 3.5 and one for 4.0 i.e. MyProject.3.5.csproj and MyProject.4.0.csproj but then I need to keep the files in sync. Is there a better way?

+1  A: 

You can create a project in 3.5 framework and use it to create Dlls for to be used in either 3.5 or 4.0 projects

A: 

I think VS can have different projects targeting different versions of .NET Framework in the same Solution without trouble. Create an empty solution (it doesn't matter which framework version you use) then add the corresponding projects (here is where you choose the correct version of .NET framework for each of your projects).

If you have a solution already, you can change the targeting version of any of your projects in the solution by going into the project properties and changing the target version of .NET Framework there.

Unlimited071