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.
This relates to #16730 to the point where I would reopen it if I had sufficient rights, but don't know if it being marked fixed will mean it doesn't end up on anyone's to-do list.
Example of breaking code:
var dict = new ConcurrentDictionary<string, string>();
dict["abc"] = "this will be removed";
dict["def"] = "This will Stay";
dict["abc"] = "This overwrites";
using(var ms = new MemoryStream())
new BinaryFormatter().Serialize(ms, dict);
var newDict = (ConcurrentDictionary<string, string>)new BinaryFormatter().Deserialize(ms);
foreach(var kvp in dict.OrderBy(kv => kv.Key))
Console.Write(" = ");
abc = This overwrites
def = This will Stay
Result with current release:
is not marked as Serializable.
Result with current code in git repository (after fix for #16730):
SerializationException: System.Collections.Concurrent.SplitOrderedList`2[System.String,System.Collections.Generic.KeyValuePair`2[System.String,System.String]] is not marked as Serializable.
There are reasons why just marking SplitOrderedList as Serializable will not be sufficient either. I describe why in more detail at #16730, along with a patch that will fix it.
Resolved in master