20

How to convert Visual Studio 2015 solution (.sln) to Visual Studio 2017.

In the past, when a solution from a previous version was opened in the newer VS there was a wizard doing the conversion, but it seems it's not the case in with these versions.

Sebastian Widz
  • 1,962
  • 4
  • 26
  • 45
  • Do you have any problem in running your solution once opened in VS2017? – Steve May 07 '17 at 22:36
  • 1
    Visual Studio 2012 and on use the same solution format, so there is no need to do any conversion. (Unless the projects themselves need to be converted.) – BJ Myers May 08 '17 at 00:01
  • @Steve: No problems so far. I was just wondering if I miss something with the solution not being upgraded or there is no need for upgrade at all. – Sebastian Widz May 08 '17 at 08:46
  • Well, an 'upgrade' should be necessary only if you change something already provided by the old format and now expressed in a total new way or removed altogether (A breaking change). In any case I "professionally" expect that a later version of a product should be able to understand and accept a data of a previous version. As far as I know there are no 'breaking changes' in the format accepted by VS2017. – Steve May 08 '17 at 08:52
  • 5
    Does the ".sln" file show the VS2017 icon? If not, look [**here**](https://stackoverflow.com/a/36669385/3135228). – Pollitzer May 29 '17 at 12:49
  • Possible duplicate of [Upgrade Visual Studio 2013 solutions to Visual Studio 2015](https://stackoverflow.com/questions/31589845/upgrade-visual-studio-2013-solutions-to-visual-studio-2015) – zakparks31191 Oct 09 '17 at 13:14
  • Possible duplicate of [Visual Studio 2012 doesn't convert vs2010 solution?](https://stackoverflow.com/questions/12095339/visual-studio-2012-doesnt-convert-vs2010-solution) – 2Toad Oct 28 '17 at 22:20
  • Visual Studio 2015 and 2017 was designed in a way to keep compatibility, https://learn.microsoft.com/en-us/visualstudio/porting/port-migrate-and-upgrade-visual-studio-projects Certain projects/solutions can be opened simultaneously in both VS releases so no upgrade is needed. – Lex Li Jan 12 '18 at 19:49
  • [Is Visual Studio 2017 backwards compatible with Visual Studio 2015 solutions?](https://stackoverflow.com/questions/41944571/is-visual-studio-2017-backwards-compatible-with-visual-studio-2015-solutions/) – Alexan Jan 12 '18 at 20:07

4 Answers4

18

Edit the .sln file with a text editor like notepad. Change the first 3 lines to


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15

The first line is empty.

When you save the changes, the icon of the .sln file is changed and the solution will be opened by VS 2017 when double-clicked.

Andi
  • 3,234
  • 4
  • 32
  • 37
8

I cannot find Retarget Solution. What I did instead:

  1. Open the solution file using Visual Studio 2017
  2. Select the solution file in Solution Explorer.
  3. Type Ctrl-S

Actually I got the idea from here: Upgrade Visual Studio 2013 solutions to Visual Studio 2015

remondo
  • 318
  • 2
  • 7
  • If you right-click on the Solution or a Project in "Solution Explorer", the context menu will have the option "Retarget Solution" (about halfway down) or "Retarget Projects" (end of first group). At least, that's how it comes up in VS 2019. File: Save All will save the projects, but for some reason NOT the solution. Your steps are required to save the solution itself. – Marc Dec 01 '21 at 19:19
2
  1. open solution(sln) with vs2017
  2. if prompt 'Retarget Project ...' click ok and done!

step 2

  1. else in Solution Explorer > right click on solution name
  2. select 'Retarget Solution'

setp 3,4 5. select last version sdk and click ok and done!

D.L.MAN
  • 990
  • 12
  • 18
0

In my case, I've searched and applied all solutions.

  • Installed netcore 2.1 x86 x64
  • Reinstalled VS2017

What was the solution? There was a global.json next to the solution and it contained an sdk parameter, I changed it to 2.1.413 (the latest as of today 25/10), and it now compiles!!!

Kat Lim Ruiz
  • 2,425
  • 2
  • 26
  • 32