[Mono-bugs] [Bug 519442] Inconsistent XML serialization between Mono 2.4 and .NET 3.5 throwing InvalidOperationException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 27 08:04:22 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=519442

http://bugzilla.novell.com/show_bug.cgi?id=519442#c14


Atsushi Enomoto <aenomoto at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #14 from Atsushi Enomoto <aenomoto at novell.com> 2010-01-27 13:04:20 UTC ---
> They won't fix or even look at the issue without "proof" that the issue
> is with them and not Mono, since everything is working on .NET.

Here is a proof lines of code: it prints nothing, which means Type.GetMethod()
returns null.

var dt = typeof (IDictionary<string,string>);
var pt = typeof (KeyValuePair<string,string>);
Console.WriteLine (dt.GetMethod ("Add", new Type [] {pt}));

http://msdn.microsoft.com/en-us/library/system.type.getmethod%28VS.80%29.aspx

<quote>
Searches for the specified *public* method whose parameters match the specified
argument types.
</quote>

(emphasis by me.)

Since IDictionary<K,V>.Add(KeyValuePair<K,V>) is *not* a "public" method, it
hence does not meet the condition explained at
http://msdn.microsoft.com/en-us/library/182eeyhh%28VS.80%29.aspx

<quote>
XmlSerializer can process classes that implement IEnumerable  or ICollection
differently if they meet certain requirements, as follows.

A class that implements IEnumerable must implement a public Add method that
takes a single parameter. The Add method's parameter must be consistent
(polymorphic) with the type returned from the IEnumerator.Current property
returned from the GetEnumerator method.
</quote>

Q.E.D.

BTW who in the NHibernate team told you like I quoted above? I'll contact him
or her to persuade to fix it. The fix is very easy and could be done without
harm. If they are productive hackers they'll change it.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list