1

I have a solution which was build using Visual Studio 2008.

I have visual studio 2008 and 2010 both installed.

When i double click to the *.sln file it always open with Visual Studio 2010.

here is some part of my *.sln file:

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HB", "HB\HB.vcproj", "{B5EE6D21-031F-44D3-993E-6580172AA5E0}"
EndProject

Can anyone tell me what is going on and what should i do to fix the issue?

Rezoan
  • 1,745
  • 22
  • 51
  • 1
    Isn't that just a computer setting? To open all .sln files with VS2010? – moffeltje Apr 21 '15 at 07:52
  • @moffeltje If its a computer setting then where the setting's location can you please tell me? what i want the 2008 sln to be opened via visual studio 2008 and 2010 sln to be opened via visual studio 2010. – Rezoan Apr 21 '15 at 08:02

3 Answers3

2

The beginning of the quoted solution indicates that it was not already opened with VS 2010 (and converted, as discussed in Working with Visual studio 2010 and 2008). The versions are discussed in How can I tell what version of Visual Studio was last used to work on a project?. According to Getting Visual Studio version of a Solution file, version 10 corresponds to VS 2008.

Starting with a VS 2008 solution file:

Double-clicking gives the default action. Right-click to get the version-selector as hinted in How to force a Solution file (SLN) to be opened in Visual Studio 2013?.

If you have problems getting the solution-chooser, this is discussed in Visual Studio Version Selector Doesn't open.

You can have multiple versions of Visual Studio installed, as discussed in Will installing Visual Studio 2010 side by side with VS2008 cause problems?. One caveat is that you should install them in their order of release (as noted in MSDN).

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • thanks for the reply. i don't really get you. the quoted solution has Format Version 10.00 which is definitely a 2008 solution . Yes it is opened with vs 2010 but not been converted. to check i have created a sample sln file with vs 2008 and it has same signature except the solution name. – Rezoan Apr 21 '15 at 08:18
  • I updated the answer (version "10" is used in two ways). Right-clicking is the point of the answer. – Thomas Dickey Apr 21 '15 at 08:19
  • 1
    Open with does not show the VS 2008. any way i have tried to browse devenv.exe location of vs 2008 on: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe". strange thing is it also opens the sln with VS 2010. – Rezoan Apr 21 '15 at 08:24
  • Offhand I don't know - I used 2008 and 2010 for a project last year. Aside from permissions, one would have problems if 2008 were installed after 2010 (but usually different symptoms). – Thomas Dickey Apr 21 '15 at 08:41
  • you got me. i did installed VS 2008 after installing VS 2010. so in that scenario what should i do. – Rezoan Apr 21 '15 at 08:51
  • I would uninstall both, and then reinstall. As I recall, you do not lose project information (but that is always something to keep in mind). – Thomas Dickey Apr 21 '15 at 08:53
  • :( disappointed. if there is no option i can find, will uninstall them both and reinstall. – Rezoan Apr 21 '15 at 08:55
0

I had a similar issue happen to me and it was because my sln file was saved in UTF-8 encoding. After saving it in ANSI, double-clicking on it would open in the correct version of Visual Studio again. It may (also) have had something to do with the byte order mark (BOM) that causes the Microsoft Visual Studio Version Selector to parse the file incorrectly depending on the file encoding.

Rami A.
  • 10,302
  • 4
  • 44
  • 87
0

When you view the icon in Windows explorer, does the icon match the Visual Studio version you want it to open with? If not, your sln file may be missing a UTF-8 signature. To fix this:

  1. Start the correct version of Visual Studio
  2. Open the solution
  3. In Visual Studio do this: Tools -> Options -> Environment -> General -> Press "Restore File Associations" button.

The icon should change to match the desired Visual Studio version and double click should open the correct version.

frankl5150
  • 21
  • 1
  • 3