Skip to content

[Repo Assist] fix: widen vswhere version range to detect VS 2019 and VS 2022 in DacPacReport#246

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-issue-193-dacpacreport-vs-detection-96a4effe535146da
Draft

[Repo Assist] fix: widen vswhere version range to detect VS 2019 and VS 2022 in DacPacReport#246
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-issue-193-dacpacreport-vs-detection-96a4effe535146da

Conversation

@github-actions

@github-actions github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Fixes automatic SqlPackage.exe detection in the DacPacReport task when Visual Studio 2019 or VS 2022 is installed, as reported in #193.

Root Cause

FindSqlPackagePath.ps1 contains the function Get-VisualStudio_15_0 which calls vswhere.exe with -version [15.0,16.0). This range only matches Visual Studio 2017 (which is version 15.x):

  • VS 2017 → version 15.x ✅ (previously found)
  • VS 2019 → version 16.x ❌ (missed)
  • VS 2022 → version 17.x ❌ (missed)

After the VS 15.x check fails, the code falls back to a registry-based scan that only covers VS 2013 and 2015. Machines with only VS 2019+ installed fell through all detection paths.

Fix

Changed the vswhere -version argument from [15.0,16.0) to [15.0,] (no upper bound), applied to both the standard and BuildTools product queries:

# Before — only VS 2017
-version [15.0,16.0) -latest -format json

# After — VS 2017, 2019, 2022 and beyond
-version [15.0,] -latest -format json

The -latest flag ensures the highest installed version is selected.

Trade-offs

  • Minimal, surgical change (2 lines)
  • Fully backward-compatible — existing VS 2017 environments are unaffected
  • No behavioral change when userSqlPackagePath is set explicitly

Test Status

⚠️ Infrastructure: Full test execution is not available in this CI environment (no node_modules). The change is a PowerShell string argument modification and was verified by code inspection. The logic change is straightforward.

Closes #193

Generated by Repo Assist

…PacReport

Previously, the vswhere call used '-version [15.0,16.0)' which only
matched VS 2017 (15.x). VS 2019 is version 16.x and VS 2022 is 17.x,
so they were never auto-detected by the task.

Change the range to '[15.0,]' (no upper bound) so any VS version >= 15.0
is found, with '-latest' selecting the highest installed version.

Closes #193

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DacPacReport: Files in extension version 1.4.152 (task version 1.2.178) differ from latest version in main branch

0 participants