-
Notifications
You must be signed in to change notification settings - Fork 64
Fix SDK version sorting to prioritize 10.0.100 #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@copilot please try again |
…omparison 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 <[email protected]>
Fixed the SDK version sorting issue in commit 56a066f. The problem was that the code was sorting bundles by DisplayName (string) instead of by the Bundle object (which uses semantic version comparison). This caused version 10.0.100 to be incorrectly sorted before versions like 2.x, 5.x, 9.x due to lexicographic ordering where "1" < "2". Now it correctly sorts by version number. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: marcpopMSFT <[email protected]>
Co-authored-by: marcpopMSFT <[email protected]>
Fixed SDK version sorting issue in
VisualStudioSafeVersionsExtractor.GetReasonRequiredStrings()method. The problem was that versions were being sorted lexicographically by their DisplayName string, causing version 10.0.100 to sort incorrectly (appearing after 9.x but before 2.x in descending order).Changes Made
Changed line 130 in
src/dotnet-core-uninstall/Shared/VSVersioning/VisualStudioSafeVersionsExtractor.csto sort by the Bundle object itself (which implements IComparable using semantic version comparison) instead of by DisplayName string:Result
Version 10.0.100 now correctly sorts numerically with other versions (12.x > 11.x > 10.x > 9.x > ... > 1.x) instead of using lexicographic string ordering where "10" would incorrectly appear between "1" and "2".
Testing
The change is minimal and surgical, affecting only one line to fix the version comparison logic.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.