1

Hi I created one sln using Visual studio 2012, but my colleague asked me to convert them into Visual studio 2010 version for the team here use 2010 as standard, instead of creating a brand new 2010 sln/project and include all files from the previous 2012 sln/project, can I modify the 2012 sln/project file directly to make the conversion? Thanks!

4 Answers 4

4

You only need the following,

  1. Create a blank solution file (.sln) in Visual Studio 2010
  2. Add all previous project files (.csproj) into this new solution file.

Then all your teammates can use this new solution to open the projects.

If you are porting Visual C++ projects, please make sure you set platform toolkit to v100 in Visual Studio 2012, before adding the projects (.vcxproj) to Visual Studio 2010 solution.

Sign up to request clarification or add additional context in comments.

4 Comments

Should I expect any pitfalls?
So far, there is none I am aware of. Visual Studio/MSBuild engine is smart enough to handle .csproj in this case.
It doesn't works as the project file created in Visual Studio 2012 is in format .vcxproj, which cannot be added to Visual studio 2010.
Just edited my answer a little bit. If you get error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. error message, then the extra step should resolve it.
3

We've managed to upgrade all of our existing Solutions and projects in-place by doing the following:

  1. For each .sln file, modify the first 2 lines in the file from

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

    (the version will be 9.00 or 10.00 depending on whether you're upgrading from VS2008 or 2010).

  2. For every csproj file, change the ToolsVersion from 3.5 to 4.0 in this line:

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

These solutions/projects now load as-is without any conversion, and build/run just fine.

1 Comment

Just as an addendum to this question, the same process also allowed us to automatically upgrade our csproj/sln files from VS2012 to VS2013. :)
2

If you are given a VS2012 C++ project, but you only have access to Visual Studio 2010. Then you can use the following method:

  1. Open the .csproj file in notepad. (It is an XML file)
  2. Look for the Platform Toolkit field and change it from v110 to v100.
  3. Save the changes.
  4. Create a blank solution file (.sln) in Visual Studio 2010
  5. Use "Add Existing Project" to add the modified .csproj file into the blank solution.
  6. Rebuild All

ps. If you are converting C++ projects from the newer Visual Studio 2013, then in Step 2, you also need to change the ToolsVersion to 4.0.

Comments

0

I ran into problems converting a solution and for me (it was an MVC.net project)

The issue was solved by modifying the following keys: {AAB7808F-0E04-46AE-8EFC-46E4C81AC77D} {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

I took the project guids out of an existing 2010 mvc.net solution and dropped them into the project I was porting from 2012.

This was in addition to modifying the sln files with the version numbers and then having to manually change the framework versions (4.5 -> 4.0)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.