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 2973 [details]
BinaryFormatter encodes serializable, non-public fields in base types of an object as:
Mono looks up the chain of base types and finds the first one whose 'Name' matches the left of the +. In cases where the actual type is not the first in the inheritance chain with the same 'Name', other implementations may write out the 'FullName' of the type on the left of the +. When reading one of these objects, mono will fail to load the type information for the field, skip de-serialization, and end up with a corrupt stream (various SerializationExceptions).
I've attached a patch that will allow 'FullName'+fieldName to be resolved in de-serialization, and the 'FullName'+fieldName to be written in serialization when the base type is not the first one in the chain with the same 'Name'.
I'll write a test for this problem as soon as I get a chance.
Created attachment 2994 [details]
Here's a test that fails on both net_2_0 and default profile without the above patch.
Fixed in master