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 for Bug 11309 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 3670 [details]
This program throws an IndexOutOfRangeException under Mono, but works properly under Microsoft .NET.
Mono incorrectly uses the Order value from MessageBodyMemberAttribute when serializing a MessageContract.
Microsoft's .NET uses the Order value as a sorting key when ordering members on a MessageContract, as documented here:
Mono, however, appears to limit the value to a 0-based index based on the number of members. If this limit is exceeded, an exception is thrown:
System.IndexOutOfRangeException: Array index is out of range.
at (wrapper stelemref) object:virt_stelemref_object (intptr,object)
at System.ServiceModel.Dispatcher.BaseMessagesFormatter.MessageObjectToParts (System.ServiceModel.Description.MessageDescription md, System.Object msgObject, System.Collections.Generic.Dictionary`2 headers, System.Object parts) [0x00000] in <filename unknown>:0
at System.ServiceModel.Dispatcher.BaseMessagesFormatter.SerializeRequest (System.ServiceModel.Channels.MessageVersion version, System.Object parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.Description.DefaultTypedMessageConverter.ToMessage (System.Object typedMessage, System.ServiceModel.Channels.MessageVersion version) [0x00000] in <filename unknown>:0
at MessageObjectToPartsException.Program.Main (System.String args) [0x00000] in <filename unknown>:0
This may be related to bug #2588, which shows a similar stack trace. Unfortunately that bug provides no further details.