SortKey.Compare returns different results on .NET 4 than .NET 2, does not match CompareOptions.Compare - by Steven Hemingray - MSFT

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 588533 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 8/23/2010 2:43:59 PM
Access Restriction Public


On .NET 4, SortKey.Compare returns the follows strings as not equal, while they are considered equal by CompareInfo.Compare on all versions and by SortKey.Compare on .NET 2.
Sign in to post a comment.
Posted by Microsoft on 9/30/2011 at 11:44 AM

We will modify the documentation for SortKey.Compare to note that SortKey.Compare and CompareInfo.Compare do not return consistent results if the CompareOptions.IgnoreWidth option is used. The change will be made in the Visual Studio 2010 documentation set for the next documentation update.

--Ron Petrusha
Common Language Runtime User Education
Microsoft Corporation
Posted by Michael S. Kaplan on 9/1/2010 at 9:17 PM
More info: the bug is in the sort key generation (the CompareOptions.IgnoreWidth is not stripping out the width from the sort key). The compare piece of the repro steps is not needed to repro the actual bug.

Also, the bug occurs in Windows 7 via LCMapString, where NORM_IGNOREWIDTH is ignored with the same wide string.
Posted by Microsoft on 8/24/2010 at 12:00 AM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 8/23/2010 at 5:11 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(