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.
Dictionary<> object serialized in mono sometimes can't be deserialized in .Net.
It is because of using custom IEqualityComparers (InternalStringComparer, IntEqualityComparer) for some basic types such as int, string and so on.
This comparers are also serialized during dictionary serialization. So .Net can't deserialize these comparers because there are no such types in .Net assemblies.
It's possible that other generic collections that used EqualityComparers are also can be bugged.
In attachment small sample.
1) Serialize test dictionary:
SerializationBugSample.exe s path_to_output_file
2) Deserialize file as test dictionary:
SerializationBugSample.exe d path_to_input_file
So steps to reproduce:
1) On Linux:
mono SerializationBugSample.exe s out.bin
2) Copy out.bin to Windows machine
3) On Windows:
SerializationBugSample.exe d out.bin
Created attachment 11424 [details]
Sample util for bug reproducing
Fixed in master and Mono 4.2
If it's possible, can you tell in which commit this fix has been made?
That's not trivial
https://github.com/mono/mono/commit/716adcebdefde72ad2421dbef919d5b7737b6a48 is good start but you basically need https://github.com/mono/referencesource/commit/e8b48b775c0b796f424d3d4e5375c6ff2dc21542#diff-d77152dd28247c03a6bce242aa3bcc47R57
Thanks a lot! I just want to understand if it's possible to create patch for my version.