https://bugzilla.novell.com/show_bug.cgi?id=430759
Summary: InvalidOperationException when XmlSerializing a generic collection (You must implement a default accessor on <MyCollection> because it inherits from ICollection) Product: Mono: Class Libraries Version: 1.9 Platform: x86 OS/Version: Ubuntu Status: NEW Severity: Normal Priority: P5 - None Component: Sys.XML AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: mono-bugs@lists.ximian.com Found By: --- Created an attachment (id=242375) --> (https://bugzilla.novell.com/attachment.cgi?id=242375) Example application The following exception is raised when serializing a collection to XML. However the issue only occurs if the object is a generic collection without an 'integer' index:- "System.InvalidOperationException: You must implement a default accessor on <MyCollection> because it inherits from ICollection" Example code is attached. It has been compiled with both gmcs (mono) and csc (windows). The .NET compiled version will successfully write the out.xml file. The mono compiled version will display the unhandled exception. Looking at the mono code online, I think the issue is in:- /trunk/mcs/class/System.XML/System.Xml.Serialization/TypeData.cs In the method 'GetIndexerProperty'. It seems that GetIndexerProperty is incorrectly looking for an int type for an indexer. Whereas the example application attached only has a string indexer. As a hack I am able to add an int indexer which always returns null. This then works and the object is correctly serialized. Thus proving that it doesn't actually require the indexer to be an int. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - mono-bugs@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-bugs