Bug 11863 - Custom binder ignored by the BinaryFormatter for properties
Summary: Custom binder ignored by the BinaryFormatter for properties
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2013-04-19 11:58 UTC by MoonStorm
Modified: 2015-03-20 06:07 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Test case (2.53 KB, text/plain)
2013-04-19 11:58 UTC, MoonStorm

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description MoonStorm 2013-04-19 11:58:19 UTC
Created attachment 3837 [details]
Test case

On serialization, the binary formatter doesn't call the custom binder for the property types, using their full type names instead. It does however call the binder when deserializing them, causing the custom binder to fail. 

Test case attached.
Comment 1 Marek Safar 2013-04-24 03:36:25 UTC
The problem is with MemberTypeMetadata::WriteTypeData and its SRE counterpart which write FieldType directly instead of using _binder. The fix is not simple because all binder::BindToName result needs to be called once per type only
Comment 2 Marek Safar 2015-03-20 06:07:30 UTC
Fixed in master