[Mono-bugs] [Bug 530588] Remoting doesn't handle types with multiple fields with the same name correctly

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Aug 29 13:19:52 EDT 2009


User robertj at gmx.net added comment

Robert Jordan <robertj at gmx.net> changed:

           What    |Removed                     |Added
                 CC|                            |robertj at gmx.net

--- Comment #1 from Robert Jordan <robertj at gmx.net>  2009-08-29 11:19:45 MDT ---
Unfortunately, there is no way to pass the field type across app domains in a
compatible manner with MS.NET.

Have a look at the signatures:

void FieldGetter (string typeName, string fieldName, ref object val);
void FieldSetter (string typeName, string fieldName, object val);

typeName is redundant in Mono, but MS.NET is relying on the type name being the
type of the *instance* the method is called on.

In Mono we could misuse typeName to carry the field type name, but this would
break the compatibility with MS.NET.

BTW, your sample is raising this exception under MS.NET:

Unhandled Exception: System.Reflection.AmbiguousMatchException: Ambiguous match
   at System.RuntimeType.GetField(String name, BindingFlags bindingAttr)
   at System.Object.GetFieldInfo(String typeName, String fieldName)
   at System.Object.FieldGetter(String typeName, String fieldName, Object& val)
   at System.Object.FieldGetter(String typeName, String fieldName, Object& val)
   at Driver.Main()

while Mono raises an InvalidCastException, because Mono's GetField does not
check for ambiguous field names.

This is probably due to MS own LAMESPEC since MSDN's GetField docs do not
specify that AmbiguousMatchException is ever thrown.

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