Visual Studio Version Selector Doesn't open

后端 未结 3 2047
梦谈多话
梦谈多话 2020-12-13 05:05

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 a

相关标签:
3条回答
  • 2020-12-13 05:21

    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.

    0 讨论(0)
  • 2020-12-13 05:26

    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
    
    0 讨论(0)
  • 2020-12-13 05:33

    The really annoying thing about this problem is that you have to run Visual Studio as administrator under windows 7 to attach to an IIS instance. The least they could do was not break the .sln files when you do that!

    The post by Jorge Poveda is correct though, the original hack no longer works but his does. It's maybe worth mentioning that you have to run everything as administrator for it to work (the command prompt and text editor).

    I think there is a better way though as we have Win 7 at work which runs as administrator and didn't have this issue. The key difference is that with this fix, the admin prompt asks you to open VSLauncher.exe, but on my work machine, it asks to open devenv.exe so VSLauncher must be OK to open VS2010 somehow. I'll ask our infrastructure guys how they did it and post back.

    0 讨论(0)
提交回复
热议问题