Skip to content

dotnet package update: use per-project packages directory - #7099

Merged
zivkan merged 1 commit into
devfrom
dev-zivkan-update-no-override-gpf
Feb 5, 2026
Merged

zivkan merged 1 commit into
devfrom
dev-zivkan-update-no-override-gpf

Conversation

@zivkan

@zivkan zivkan commented Feb 4, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14735

Description

I had originally copy/pasted some code from dotnet package add for dotnet package update, but it turns out that dotnet packge add is the only command NuGet has to override the packages directory via --package-directory. Since dotnet package update doesn't have such a CLI option, we shouldn't be setting the GlobalPackageFolder property on the RestoreArgs object, to allow each project to potentially override their packages directory via MSBuild property.

So, this PR stops setting the property. Also see #7014 (comment) for more context.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests This code programmatically runs restore, and there are already tests for restore on projects that set the RestorePackagesPath property
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc no changes to documented features

@zivkan
zivkan requested a review from a team as a code owner February 4, 2026 06:15
@zivkan
zivkan merged commit 849933c into dev Feb 5, 2026
16 checks passed
@zivkan
zivkan deleted the dev-zivkan-update-no-override-gpf branch February 5, 2026 23:20
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.

dotnet package update sometimes save packages to the wrong location

4 participants