Skip to content

Commit 56a066f

Browse files
CopilotmarcpopMSFT
andcommitted
Fix SDK version sorting to use version comparison instead of string comparison
Changed VisualStudioSafeVersionsExtractor.GetReasonRequiredStrings to sort by Bundle object (which uses semantic version comparison) instead of DisplayName string. This fixes the issue where version 10.0.100 was incorrectly sorted before 2.x, 5.x, etc. due to lexicographic string ordering where "1" < "2". Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
1 parent 5dd34a4 commit 56a066f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotnet-core-uninstall/Shared/VSVersioning/VisualStudioSafeVersionsExtractor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static Dictionary<Bundle, string> GetReasonRequiredStrings(IEnumerable<Bu
127127
return requirementStringResults
128128
.GroupBy(pair => pair.bundle)
129129
.Select(group => group.First()) // Remove duplicates
130-
.OrderByDescending(pair => pair.bundle.DisplayName)
130+
.OrderByDescending(pair => pair.bundle)
131131
.ToDictionary(i => i.bundle, i => i.Item2);
132132
}
133133
}

0 commit comments

Comments
 (0)