Zhi Wang
Zhi Wang

Reputation: 1168

How to convert vs2012 sln/project files to vs2010?

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!

Upvotes: 1

Views: 15295

Answers (4)

Joshua Kan
Joshua Kan

Reputation: 395

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.

Upvotes: 2

Webreaper
Webreaper

Reputation: 622

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.

Upvotes: 3

Gary
Gary

Reputation: 2261

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)

Upvotes: 0

Lex Li
Lex Li

Reputation: 63298

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.

Upvotes: 4

Related Questions