Skip to content

Get override paths via global properties in static restore - #7383

Merged
zivkan merged 2 commits into
devfrom
dev-zivkan-PackageSpecFactory-global-properties
May 13, 2026
Merged

zivkan merged 2 commits into
devfrom
dev-zivkan-PackageSpecFactory-global-properties

Conversation

@zivkan

@zivkan zivkan commented May 12, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14904

Description

As per the linked issue, when a project file has a property <RestoreSources> with a relative path, normal restore would always resolve the relative path using the project directory as the base path, but static graph restore would use the process current working directory as the base path.

This was due to a bug in MSBuildProjectInstance, where GetGlobalProperty would incorrectly get the evaluated project properties, instead of the global properties. Since PackageSpecFactory was a copy of static graph restore, it had the same bug, so both need to be fixed.

I validated the integration test fails without the change and passes with the change.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. Although there's a behavior change, it's aligning static graph restore with normal restore

@zivkan
zivkan requested a review from a team as a code owner May 12, 2026 01:18
@zivkan
zivkan requested review from jebriede and martinrrm May 12, 2026 01:18
@zivkan
zivkan requested review from jeffkl and nkolev92 May 12, 2026 02:29
@zivkan
zivkan merged commit 552aff0 into dev May 13, 2026
17 of 18 checks passed
@zivkan
zivkan deleted the dev-zivkan-PackageSpecFactory-global-properties branch May 13, 2026 00:54
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.

static graph restore doesn't handle relative paths for RestoreSource correctly

3 participants