Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 11748 [details]
In Xamarin.Mac, zh-Hans and zh-CHS are treated as equal, whereas in .NET on Windows this is not the case.
## Steps to reproduce
1. Download attached .cs file which provides example code.
2. Compile and run.
## Expected result
## Actual result
"An item with the same key has already been added" exception due to zh-Hans and zh-CHS being equal when they should not be.
If you run the resulting exe on Windows it works without throwing an exception.
Xamarin.Mac is the Mac bindings for writing GUI applications. In the example above, there is no GUI needed to reproduce the issue. I'm moving to the ClassLib section.
Fixed in master and Mono 4.2
Thanks for attempting to fix this Marek!
The fix (c67cb40) you provided still doesn't quite match the documentation & the MS implementation.
Mono Docs: http://developer.xamarin.com/api/member/System.Globalization.CultureInfo.Equals(System.Object)/
"Two CultureInfo objects are considered equal if their CultureInfo.Name and CultureInfo.CompareInfo properties are equal."
The implementation you provided checks the CultureInfo.Name, but not the CultureInfo.CompareInfo property. (It still checks the LCID)