Upgrade Visual Studio 2013 solutions to Visual Studio 2015

Visual StudioVisual Studio-2013Visual Studio-2015

Visual Studio Problem Overview


I have installed both Visual Studio 2013 and Visual Studio 2015. Projects and solutions that were created in VS2013 are opened by VS2013 as I would expect, but I would like to be able to upgrade those files so that they would be opened by VS2015 when double clicked.

How can I upgrade solution files that are in VS2013 format so that the Microsoft Visual Studio Version Selector will open them in VS2015?

Visual Studio Solutions


Solution 1 - Visual Studio

The simplest solution IMO (also worked for 2012 and 2013) is:

  1. Open the solution file using Visual Studio 2015
  2. Select the solution file in Solution Explorer
  3. Select File / Save MySolution.sln As...
  4. Overwrite the existing solution file.

Solution 2 - Visual Studio

Change the version in the .sln file

# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0

To match whatever version you have

As of this morning my VS Enterprise is 14.0.23107.0

Example:

# Visual Studio 2015
VisualStudioVersion = 14.0.23107.0

Visual Studio 2015 Update 3 is 14.0.25420.1

Solution 3 - Visual Studio

Note: This works for VS 2015 and 2017

An alternative to hand-editing the .sln file or re-saving on top of the original .sln file:

  1. Open the solution in Visual Studio
  2. Right click solution > Add > New Solution Folder (name does not matter)
  3. Save solution
  4. Delete the newly added solution folder
  5. Save solution

The solution will now be upgraded.

Solution 4 - Visual Studio

I ran across this looking for the same thing. The accepted answer works, but I noticed some comments about not being batchable. I found an option for batching and I thought I'd share.

You can use the /upgrade option in devenv.com. This means it's batchable. For example, to recurse the current directory upgrading all .sln files (after backing them up), you could do this:

dir -Recurse -path ".\" *.sln | ForEach-object {
	Copy-Item $_.FullName "$($_.DirectoryName)\$($_.Name.Remove($_.Name.Length - $_.Extension.Length)).vs2013$($_.Extension)";
	& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" /upgrade $_.FullName
}

Solution 5 - Visual Studio

I solved the problem by this: Right click on solution, "Retarget solution".(vs2013)

Solution 6 - Visual Studio

The other solutions here didn't work for me. My project was created in Visual Studio 2012, and I am now using Visual Studio 2015, but this should work if you're going from 2013 to 2015. This is how you manually upgrade a project from a earlier version to a newer one:

  1. Open the Developer Command Prompt for VS2015 (to find it: https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx)
  2. Type in devenv SolutionFile | ProjectFile /upgrade and press enter

Where SolutionFile | ProjectFile is the full path with filename of your .sln file.

https://msdn.microsoft.com/en-us/library/w15a82ay.aspx

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBen PschierlView Question on Stackoverflow
Solution 1 - Visual StudioMatthias LoerkeView Answer on Stackoverflow
Solution 2 - Visual StudioZach LeightonView Answer on Stackoverflow
Solution 3 - Visual StudioMetro SmurfView Answer on Stackoverflow
Solution 4 - Visual StudioPeter RitchieView Answer on Stackoverflow
Solution 5 - Visual StudioWooodHeadView Answer on Stackoverflow
Solution 6 - Visual StudioAzNjoEView Answer on Stackoverflow