March 11, 2014

Open Visual Studio IDE from Run command of your choice ( when you have 2 different versions of Visual Studio)

Question:
When you have two versions of Visual Studio installed on the same machine, for example Visual Studio 2010 and Visual Studio 2012, you want to always open Visual Studio 2012 as default?

Solution: 
When you have two versions of Visual Studio installed, say first you installed Visual Studio 2010 and then installed Visual Studio 2012. If you are using shortcut to open Visual Studio IDE
Start - Run - devenv.exe
By default Visual Studio 2010 will be opened. As Visual Studio 2010 was installed first and a register entry was done.

Now that you have installed Visual Studio 2012 without uninstalling Visual Studio 2010, this registry entry is not made for Visual Studio 2012

You can make Visual Studio 2012 to open as default, by modifying the registry entry. See below the steps.
  • Click on Windows Start button.
  • Type regedit.exe in the search text box, regedit.exe will appear. 
  • Click on the regedit.exe. This will open the Registry Editor.
  • Navigate to the following path in the left section
    •  HKEY_LOCAL_MACHINE => SOFTWARE => Microsoft => Windows => CurrentVersion => App Paths => devenv.exe
  • Click on devenv.exe you will see the default key on the right section.
  • Double click on default to change the value.
  • In this case for Visual Studio 2010 the value would be  (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe)
  • Change this value to the path where Visual Studio 2012 devenv.exe is located, in this case (C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe) and click Ok.
  • Close Registry editor.
  • Now when you type devenv.exe from Run it is open Visual Studio 2012.
Following are default path where Visual Studio IDE is installed by default 

Visual Studio 2008
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

Visual Studio 2010
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe 

Visual Studio 2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe 

Thanks,
Hussain Patel

No comments:

Post a Comment