[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
Conversation
…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>
This was referenced Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Fixes automatic
SqlPackage.exedetection in the DacPacReport task when Visual Studio 2019 or VS 2022 is installed, as reported in #193.Root Cause
FindSqlPackagePath.ps1contains the functionGet-VisualStudio_15_0which callsvswhere.exewith-version [15.0,16.0). This range only matches Visual Studio 2017 (which is version 15.x):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
-versionargument from[15.0,16.0)to[15.0,](no upper bound), applied to both the standard and BuildTools product queries:The
-latestflag ensures the highest installed version is selected.Trade-offs
userSqlPackagePathis set explicitlyTest Status
node_modules). The change is a PowerShell string argument modification and was verified by code inspection. The logic change is straightforward.Closes #193