Skip to content

feat: support vsInstanceVersion vendor field for Ninja presets - #5004

Open
Omotola wants to merge 2 commits into
mainfrom
dev/oakeredolu/4698-vs-instance-selection-ninja
Open

feat: support vsInstanceVersion vendor field for Ninja presets#5004
Omotola wants to merge 2 commits into
mainfrom
dev/oakeredolu/4698-vs-instance-selection-ninja

Conversation

@Omotola

@Omotola Omotola commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #4698

When multiple VS versions are installed, the extension always picks the latest one for Ninja presets. This adds a vsInstanceVersion vendor field so users can pin a specific VS major version without hardcoding paths.

The value is just the major version number (17 = VS2022, 18 = VS2026). Example:

{
  "name": "ninja-vs2022",
  "generator": "Ninja",
  "vendor": {
    "microsoft.com/VisualStudioSettings/CMake/1.0": {
      "vsInstanceVersion": 17
    }
  }
}

Tested on a machine with both VS2022 and VS2026 installed - correctly picks the specified version and displays it in the configure log
After Change
image

Omotola and others added 2 commits July 23, 2026 17:49
Allow users to specify a preferred Visual Studio major version in
CMakePresets.json vendor settings, enabling VS instance selection for
Ninja generator presets without hardcoding installation paths.

Example preset configuration:
{
  "vendor": {
    "microsoft.com/VisualStudioSettings/CMake/1.0": {
      "vsInstanceVersion": 17
    }
  }
}

This picks the VS2022 (major version 17) dev environment even when
VS2026 (major version 18) is also installed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e55cc9b5-dc8d-413d-a219-8c6418ec1d25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Presets Use VS2022 clang-cl When VS2026 Is Installed

1 participant