Force VSLauncher.exe from folder to open Visual Studio specific version

Vernou 61 Reputation points
2021-02-16T13:22:21.973+00:00

I have some Visual Studio version on my computer. From explorer in folder, I have in the context menu the option "Open Visual Studio", but this option open the wrong Visual Studio version.

This option come from registry :

HKEY_CLASSES_ROOT\Directory\background\shell\AnyCode\command
"C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\\VSLauncher.exe" "%V" source:ExplorerBackground

The easy solution is to modify this registry entry to start the expected Visual Studio version, but VSLauncher is used by other tools. I prefer to modify the behavior of VSLauncher to start my expected Visual Studio version.

How can force VSLauncher to start a specific Visual Studio version?

Edit :

The two Visual Studio versions on my computer are :

  • Visual Studio 2019 Professional
  • Visual Studio 2019 Enterprise

For license reason, I need open the professional edition by default.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,775 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
989 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 28,676 Reputation points Microsoft Vendor
    2021-02-17T09:08:35.677+00:00

    Hi @Vernou ,

    Welcome to Microsoft Q&A forum.

    I think the highest(newest) version of Visual Studio will be selected to open the folder when you click the option(Open in Visual Studio) in the context menu(in a folder). But if you click and select the specific file for example .sln file, the most suitable version of Visual Studio will be selected to open this file.

    For your requirement, I’m afraid, it is not possible to modify this option. I suggest you directly suggest this feature to VS Product Team from VS > Help > Send Feedback > Suggest a Feature…

    Sincerely,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 50,111 Reputation points
    2021-02-16T15:28:46.12+00:00

    VSLauncher looks at the version of VS that was used to create the solution/project. It then tries to use that version. So if you created a solution in VS 2017 and then installed VS 2019 then VSLauncher will try to use VS 2017 to open it. This is by design. To "properly" fix it you should update the solution to VS 2019 (or whatever) then the launcher will use the newer version.

    For most other file associations you can go into VS and force it to reassociate the file extensions but this won't impact VSLauncher.

    1 person found this answer helpful.