Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Visual Studio determine a solution file's version?

Tags:

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

like image 564
Hakan Kara Avatar asked Oct 11 '12 12:10

Hakan Kara


People also ask

How do I know which version of Visual Studio project I have?

The version should be in the first few lines following a "#" symbol. Show activity on this post. Either the ToolsVersion attribute or ProductVersion tag should lead you to the version of Visual Studio.

What is the difference between project and solution in Visual Studio?

A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.

What is the solution file in Visual Studio?

A solution is a structure for organizing projects in Visual Studio. The solution maintains the state information for projects in two files: . sln file (text-based, shared) .


2 Answers

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
like image 94
Jesse Avatar answered Oct 07 '22 23:10

Jesse


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.

like image 44
Oded Avatar answered Oct 07 '22 23:10

Oded