2

I am developing a desktop based application in Visual Studio 2008. the solution has 24 projects. I am using .Net Framework 3.5

I want to Use Visual studio 2010. but problem is this that there are other team members also which are using Visual studio 2008.

How can i make solution and project files compatible with both versions??

Mohsan
  • 2,483
  • 6
  • 47
  • 62
  • possible duplicate of [Downgrade C# Project from visual studio 2010 to visual studio 2008](http://stackoverflow.com/questions/2688191/downgrade-c-project-from-visual-studio-2010-to-visual-studio-2008) – slugster Mar 10 '11 at 05:55
  • 1
    Why on earth is your entire team not using the same version of VS? – Kirk Woll Mar 10 '11 at 05:56
  • @Mohsan, follow the link in my comment above, read the answer by Marc Gravell, and the comments to his reply. – slugster Mar 10 '11 at 05:57
  • Best to just get everyone on the 2010 bandwagon – Shai UI Mar 10 '11 at 05:58
  • @slugster, IMO that link isn't too relevent. You really can't have one solution that is simultaneously compatible with both versions of VS (this contrasts with the link which is about going *back* from 2010 to 2008 -- that's an entirely different proposition than what this OP is asking for.) Furthermore, the very instant someone uses **dynamic** or some other incompatible language feature, this idea will quickly run amok. – Kirk Woll Mar 10 '11 at 06:17
  • after changing Tools Version to 3.5. Visual Studio 2010 asks me to upgrade your project.. After upgrading it replaces this 3.5 with 4.0 – Mohsan Mar 10 '11 at 06:40
  • You can retarget it back to 3.5 by changing it in the Project Properties. Be aware that you may have to remove some references that are not in 3.5. – Daniel McQuiston Mar 10 '11 at 18:53

2 Answers2

2

You must have two separate solution files. Visual Studio (any version) tries to upconvert any solution file to the next version based on the version inside the solution file e.g.

Solution File for VS 2010:

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010

Solution File for VS 2008:

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008

Solution File for VS 2005:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005

The same goes with project files, so you will have to have separate versions of each project file. Each version of Visual Studio have their specific needs. E.g. for a Web Application Project Template in VS 2010 there are web config transform files that make no sense to earlier versions of VS.

Bottom line is it is possible to maintain different solution and project files in Visual Studio 2008 and 2010. Visual Studio 2005 is out of the question since there is no multi-targeting support and you are using 3.5 of the Fwk.

Daniel McQuiston
  • 2,056
  • 2
  • 15
  • 15
1

You need separate solution files for each version of Visual Studio, but they can reference the same project files. Typically you don't add or remove projects from a solution, so this double-entry is tolerable. It's unfortunate that there's 4 characters different between a VS 2008 and a VS 2010 solution file. See http://robrich.org/archive/2010/04/20/working-with-both-vs-2010-and-2008-on-the-team.aspx

robrich
  • 13,017
  • 7
  • 36
  • 63