Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force a Solution file (SLN) to be opened in Visual Studio 2013?

Trying to open a VS 2012 solution (SLN file) explicitly in VS 2013 succeeds. Simply double-clicking it in Windows Explorer still opens it in VS 2012 instead.

I've read "Visual Studio 2012 doesn't convert vs2010 solution?" and followed the suggestion to "Save As..." the solution file.

Still it opens in VS 2012 by default.

My question:

How to change a SLN file to force it being opened in Visual Studio 2013?

like image 397
Uwe Keim Avatar asked Oct 22 '13 08:10

Uwe Keim


People also ask

How do I open a solution file in Visual Studio?

You can open any solution, project, folder or file in Visual Studio Code by simply right-clicking it in Solution Explorer and select Open in Visual Studio Code.

How do I open a project file without SLN?

If you have a web project (without a . sln), you must do: Menu File → Open → Web Site... And choose the folder where the project is.


2 Answers

The .sln file indicates the intended version as one of the early lines - for example:

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

or:

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

However - it can only make use of this if the default application for .sln files is the "Microsoft Visual Studio Version Selector". It is not uncommon for the default .sln application to be a specific version instead. In windows 8:

enter image description here

you can tell which is the default because it says "keep using":

enter image description here

enter image description here

like image 146
Marc Gravell Avatar answered Sep 21 '22 17:09

Marc Gravell


Note that you can also force the upgrade of a .sln or .proj file by using the commandline, where devenv is the target IDE version:

devenv "MyProject.sln" /upgrade 

Example:

"%programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" "D:\Source\MySolution.sln" /upgrade 

Note that this does not open Visual Studio. An alternative is to, from within the IDE, select "Save As" for your solution file and overwrite or save the solution under new name.

Read more: http://msdn.microsoft.com/en-us/library/w15a82ay.aspx

like image 29
zumey Avatar answered Sep 19 '22 17:09

zumey