27

Think that I have two solutions: vs2009.sln and vs2010.sln. Both of solution files have the same extension (.sln) but they have different icons. And they are opened in the related version of visual studio. I wonder how does visual studio determine this?

Edit: Visual studio version selecter is ok but i wonder how can the icon be different even the extensions are same? I used to know that every extension has only one icon in registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\explorer\Shell Icons

2.Edit: I found the answer finally. If anyone wonders about that, the answer is here http://msdn.microsoft.com/en-us/library/cc144122%28VS.85%29.aspx

3
  • 2
    Duplicate of stackoverflow.com/questions/4693562/…
    – user247702
    Oct 11, 2012 at 12:38
  • Thanks but I couldn't find what i am looking for on that link
    – Hakan Kara
    Oct 11, 2012 at 13:11
  • 1
    It answers both your questions. The icon is determined by an icon handler shell extension and (as explained in the answers below) the VS version to open is determined by the Version Selector.
    – user247702
    Oct 11, 2012 at 13:44

3 Answers 3

43

Open your .sln file with Notepad or another text editor. Look for Format Version on the first line which correlates with a Visual Studio version. Here's some that I'm familiar with:

  • Format Version 8.00 is Visual Studio 2003
  • Format Version 9.00 is Visual Studio 2005
  • Format Version 10.00 is Visual Studio 2008
  • Format Version 11.00 is Visual Studio 2010
  • Format Version 12.00 is Visual Studio 2013
3
  • You can open Format Version 12.00 in VS2010 SP1 also.
    – shashwat
    Apr 21, 2017 at 9:11
  • What about 2015 and 2017?
    – rory.ap
    Sep 19, 2018 at 14:34
  • 4
    @rory.ap 2015, 2017, and 2019 all still use version 12. Dec 10, 2018 at 19:25
11

Solution files are text files.

The very first line contains version information.

For example, for a Visual Studio 2010 solution you will find:

Microsoft Visual Studio Solution File, Format Version 11.00

Additionally, when you have several different versions of Visual Studio installed, the .sln file goes through the Visual Studio Version Selector utility that reads this and opens the corresponding version of Visual Studio. Check the .sln file associations.

1
  • You can open Format Version 12.00 in VS2010 SP1
    – shashwat
    Apr 21, 2017 at 9:12
2

Try opening the .sln in a notepad

the first line itself says Microsoft Visual Studio Solution File, Format Version 10.00 or 11 or whatever version it is

2
  • And the second line says something like: # Visual Studio 14 but it uses 2010 for vs2010, 2013 for vs2013, and 14 for vs2015. vs2010 uses Format Version 11.00 and vs2013 and 2015 use Format Version 12.00. Don't know about other versions. Sep 22, 2016 at 18:38
  • vs2010 uses msvc-10.0 in boost build. May 12, 2017 at 4:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.