Fix version conflict detection in new dependency resolver#6999
Merged
Conversation
src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs
Outdated
Show resolved
Hide resolved
nkolev92
reviewed
Dec 11, 2025
Member
nkolev92
left a comment
There was a problem hiding this comment.
I have some questions that might be easier to ask offline, so I'll ping you.
test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommand_AlgorithmEquivalencyTests.cs
Show resolved
Hide resolved
nkolev92
previously approved these changes
Dec 12, 2025
zivkan
previously approved these changes
Dec 12, 2025
src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs
Outdated
Show resolved
Hide resolved
donnie-msft
reviewed
Dec 12, 2025
test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommand_AlgorithmEquivalencyTests.cs
Outdated
Show resolved
Hide resolved
zivkan
previously approved these changes
Dec 12, 2025
donnie-msft
previously approved these changes
Dec 12, 2025
Nigusu-Allehu
previously approved these changes
Dec 12, 2025
42d9ecd
73c3154 to
42d9ecd
Compare
42d9ecd to
710c2f5
Compare
zivkan
approved these changes
Dec 17, 2025
3 tasks
jeffkl
added a commit
that referenced
this pull request
Dec 23, 2025
)" This reverts commit aea7daa.
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#14675
Description
The new dependency resolver loops through the defined graph looking for cycles and conflicts. If a good node is walked first, a version conflict is detected later and works just fine. However, if the conflicting node is walked first, it is added to the graph as a conflict but then the good node is never walked because the conflicting node was walked first.
This change updates the version conflict detection logic to handle the case where the ordering of the conflict would cause it to not work correctly.
PR Checklist