Visual Studio Version Selector Doesn't open

26,500

Solution 1

If you are running Vista or Windows 7 with the UAC enabled and have "Run this program as an Administrator" checked on the Compatibility tab for the Visual Studio exe (devenv.exe), you will get this behavior when you try to open a sln file directly from Windows Explorer.

One solution is to go to "%ProgramFiles%\Common Files\Microsoft Shared\MSEnv" or ("%ProgramFiles(x86)%\Common Files\Microsoft Shared\MSEnv" for 64-bit systems) and right-click VSLauncher.exe and select Properties. On the Compatibility tab, check "Run this program as an Administrator". Now when you try to open a sln file directly from Windows Explorer, you will get the elevation prompt and it will open the correct version of Visual Studio for the file.

Solution 2

Apparently, the "run as administrator" hack does not work anymore in Visual Studio 2010 SP1. Fabian describes a workaround here:

Getting Visual Studio 2010 SP1 to run elevated when launching .sln files

To sum it up:

  1. Backup VSLauncher.exe

  2. From within a Visual Studio 2010 Tools prompt, extract the manifest from VSLauncher.exe:

    mt -inputresource:"VSLauncher.exe" -out:VSLauncher.exe.manifest
  1. Alter the VSLauncher.exe.manifest file:
    <requestedPrivileges>
       <requestedExecutionLevel level="requireAdministrator" uiAccess="false">
       </requestedExecutionLevel>
    </requestedPrivileges>
  1. Write back the manifest into VSLauncher.exe:
    mt -outputresource:VSLauncher.exe -manifest VSLauncher.exe.manifest
Share:
26,500
Jonas Stawski
Author by

Jonas Stawski

I am a husband, father of three and a Microsoft Most Valuable Professional (MVP) and a Microsoft Certified Application Developer (MCAD) with over a decade of experience building and architecting .NET applications and even more years of professional experience using Microsoft development technologies such as ASP, Visual Basic, and SQL Server. I have worked in several markets such as insurance, real estate, leasing, medical, hospitality, among many others.

Updated on November 28, 2020

Comments

  • Jonas Stawski
    Jonas Stawski over 3 years

    I have Visual Studio 2008 and 2010 installed side by side, but trying to open either a 2008 or 2010 sln file results in nothing. The hour glass comes on for about a second and then it goes away and nothing is opened.

    I read somewhere to relate sln file to VS directly, but I can't go that route because I don't want 2008 solutions to open with 2010. Does anyone know what the problem might be and how to fix it?