Conversation
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
When a PackageReference has no inline version, before giving up: check
for a local VersionOverride attribute first (wins over CPM entirely if
present), otherwise walk up from the project's directory toward the repo
root looking for the nearest Directory.Packages.props - the same
resolution NuGet itself uses, so nested/multiple CPM files naturally
resolve to whichever governs that specific project ("closest wins").
The matching PackageVersion entry there is patched instead of the
evidence file; the evidenced project's own lock file is still
regenerated afterward, since its resolved version now depends on that
central file.
NoInlineVersionFixNotSupported now only covers what's genuinely left
unresolvable: a governing file that doesn't declare the package, or no
Directory.Packages.props found in the ancestor chain at all.
Sibling projects that share the same governing file but weren't
evidenced are not proactively restored - a known scope boundary, not a
gap: their own lock files can go stale relative to the bumped central
version until they're separately evidenced and fixed.
…root bounds. Co-authored-by: Cursor <cursoragent@cursor.com>
Evidence for a CPM- or Directory.Build.props-resolved package only ever points at packages.lock.json, never the .csproj - the version text never appears there at all. techutils' Nuget descriptor list didn't recognize lock files, so that evidence was discarded before reaching any updater. Added it there, and taught collectProjectFilePaths to resolve a lock-file evidence path to the sibling project file in the same directory. Added a Directory.Build.props/.targets fallback, tried after Central Package Management comes back unresolved, reusing the same walk-up and Import-following logic (generalized from the CPM-only version). Broadened the fallback trigger to any failure from the inline-version check, not just "found without a version" - a package injected purely via Directory.Build.props has no local PackageReference to find at all, which previously returned a plain "not found" that never attempted the fallback chain. Resolved $(MSBuildThisFileDirectory) in Import paths before checking for unresolvable macros, since it's a trivial, common case that doesn't need full MSBuild evaluation.
orto17
force-pushed
the
feature/nuget-cpm-support
branch
from
September 17, 2026 08:43
567251f to
d6af509
Compare
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.
When a PackageReference has no inline version, before giving up: check for a local VersionOverride attribute first (wins over CPM entirely if present), otherwise walk up from the project's directory toward the repo root looking for the nearest Directory.Packages.props - the same resolution NuGet itself uses, so nested/multiple CPM files naturally resolve to whichever governs that specific project ("closest wins"). The matching PackageVersion entry there is patched instead of the evidence file; the evidenced project's own lock file is still regenerated afterward, since its resolved version now depends on that central file.
NoInlineVersionFixNotSupported now only covers what's genuinely left unresolvable: a governing file that doesn't declare the package, or no Directory.Packages.props found in the ancestor chain at all.
Sibling projects that share the same governing file but weren't evidenced are not proactively restored - a known scope boundary, not a gap: their own lock files can go stale relative to the bumped central version until they're separately evidenced and fixed.
devbranch.go vet ./....go fmt ./....