Repository navigation
Preserve restore no-op for case-equivalent project paths - #7699
Merged
Merged
Conversation
Contributor
Author
@dotnet-policy-service agree company="Microsoft" |
nkolev92
reviewed
Sep 12, 2026
nkolev92
approved these changes
Sep 14, 2026
zivkan
approved these changes
Sep 15, 2026
This was referenced Sep 16, 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.
Bug
Fixes: NuGet/Home#15081
Description
Preserve restore's no-op cache when dependency graphs differ only in project-path casing on case-insensitive platforms. Project identity lookup already uses the OS-dependent path comparer, but hash serialization retained the original spelling, allowing equivalent paths to invalidate the cache across graph evaluations.
Normalize only project/restore identity keys, project paths, project-reference keys and paths, and the derived output path while hashing. The output path is needed because it inherits the project directory's casing; removing its normalization breaks the case-only hash and second-restore regressions. Other restore paths retain their existing hash behavior, and the production diff introduces no LINQ. Normal serialized output and graph objects retain their original spelling. Both FNV and legacy SHA512 use the same normalization.
Added regression coverage for root and referenced-project paths, unchanged serialized output, and continued invalidation for other restore-input changes. Unrelated config, package-cache, fallback, lock-file, runtime-graph, and asset paths are held fixed in the casing reproduction. A Windows local-feed test verifies that changing only the project-directory casing between restores returns
NoOpRestoreResultwithout rewriting the assets file.Validation on Windows:
net472andnet10.0.dotnet format whitespace --verify-no-changes NuGet.sln --no-restorecompleted successfully with workspace-load warnings;git diff --checkpassed.No public APIs, settings, environment variables, or output schemas are added or changed, so a documentation issue or PR is not applicable.
PR Checklist