Minimal fixtures to verify the nuget manager handles MSBuild SDK dependencies without a regex customManagers workaround.
Each folder exercises one extraction path. All use outdated SDK versions that Renovate should propose upgrading.
| Folder | What it tests |
|---|---|
01-sqlproj-sdk-element |
<Sdk Name="..." Version="..." /> in .sqlproj (SSDT) |
02-csproj-sdk-element |
<Sdk Name="..." Version="..." /> in .csproj |
03-csproj-project-sdk-attribute |
<Project Sdk="name/version"> |
04-csproj-import-sdk |
<Import Sdk="..." Version="..." /> |
05-global-json-msbuild-sdks |
global.json → msbuild-sdks |
06-package-reference-regression |
Sdk + PackageReference in the same file (Sdk uses hybrid semver; PackageReference unchanged) |
MSBuild SDK Version values are exact pins, but default NuGet versioning treats bare versions as minimum ranges (>=), so preview pins like 0.1.19-preview resolve to the latest release and skip updates.
The fix:
- Adds
.sqlprojto default nugetmanagerFilePatterns - Applies
applyMsbuildSdkVersioning()at extract time: strictsemverwhen the pin is valid semver, otherwisesemver-coercedfor non-standard NuGet version strings (e.g. four-segment revisions)
From a Renovate checkout that includes the MSBuild SDK fix:
pnpm start -- azurevoodoo/RenovateMSBuildSDKPRFix --dry-run=full --git-author="Your Name <you@users.noreply.github.com>"Live run (creates/updates PRs):
pnpm start -- azurevoodoo/RenovateMSBuildSDKPRFix --pr-concurrent-limit=0 --pr-hourly-limit=0 --git-author="Your Name <you@users.noreply.github.com>"- 7 nuget files matched → 6 package files, 7 dependencies
- msbuild-sdk deps show
versioning: semverfor the pins in this repo (all valid semver) - Non-empty
updatesfor outdated SDKs (e.g.Microsoft.Build.Sql0.1.x-preview→2.2.0,Microsoft.Build.NoTargets3.4.0→3.7.134) - 2 PR branches:
renovate/microsoft.build.sql-2.x,renovate/microsoft.build.notargets-3.x - PackageReference in
06still uses nuget versioning at lookup (noversioningon extract)
- Sdk deps get
versioning: nuget,currentVersionresolves to latest, andupdates: []for preview pins like0.1.19-preview .sqlprojfiles are not scanned unlessnuget.managerFilePatternsis configured
Example PRs created from a forked Renovate build against this repo:
- PR #1 —
Microsoft.Build.NoTargets3.4.0 → 3.7.134 (scenarios 02–04) - PR #2 —
Microsoft.Build.Sql0.1.x-preview → 2.2.0 (scenarios 01, 05, 06)
- Microsoft.Build.Sql — SSDT SQL projects; old
0.1.x-previewversions vs current2.xon nuget.org - Microsoft.Build.NoTargets — SDK-style projects;
3.4.0is intentionally old - Microsoft.Data.SqlClient — ordinary
PackageReferencein the regression scenario