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 10325 [details]
Run ConsoleApp from the solution both with Xamarin.Mac and Visual Studio 2012.
I am evaluating Xamarin.Mac on OSX.
With the mono compiler there is no way to mark a class serializable in a PCL (Portable Class Library). Everything works fine with the windows csc, but not with the mono compiler.
I have made a small test console application:
- during compile, the SerializableAttribute used on Lib1.MyClass is resolved using ShimLib.
- but in the bin directory, ShimLib is overwritten with ShimLib.Forward (having the same strong name), which doesn't contain any implementation but forwards SerializableAttribute to mscorlib (using TypeForwardedTo).
The application displays the name and location of the SerializableAttribute used on Lib1.MyClass, which is correct both with csc and mono compiler.
But Lib1.MyClass is only serializable with csc!
I know that type-forwarding is a hack, but its needed many times when working with PCLs.
Please make the mono compiler handle this situation, or make it similar to the windows csharp compiler which doesn't check the origin of SerializableAttribute.
Fixed in master