[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 15:27:36 EDT 2009


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

User robertj at gmx.net added comment
http://bugzilla.novell.com/show_bug.cgi?id=530588#c4





--- Comment #4 from Robert Jordan <robertj at gmx.net>  2009-08-29 13:27:30 MDT ---
For this code (w/out generics):

---
using System;
using System.Reflection;

public class Server : MarshalByRefObject
{
    public int A;
    public DateTime B;  // <-- rename to "A" in IL and recompile
}

class T
{
    static void Main ()
    {
        AppDomain d = AppDomain.CreateDomain ("FooBar");
        Server srv = (Server) CreateInstance (d, typeof (Server));

        srv.A = 42;
        srv.B = DateTime.Now; // <-- rename to "A" in IL and recompile
    }

    static object CreateInstance (AppDomain d, Type t)
    {
        return d.CreateInstanceAndUnwrap (t.Assembly.FullName, t.FullName);
    }
}

---


I get under MS.NET 1.1 this stack trace:


Unhandled Exception: System.Runtime.Remoting.RemotingException: The argument
type 29.08.2009 21:16:50 cannot be converted into parameter type System.Int32.

Server stack trace:
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type
pt)

   at System.Object.FieldSetter(String typeName, String fieldName, Object val)
   at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M
ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInC
ontext, Object[]& outArgs)
   at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
req
Msg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgDa
ta, Int32 type)
   at System.Object.FieldSetter(String typeName, String fieldName, Object val)
   at T.Main()


And under MS.NET 3.5:


Unhandled Exception: System.Runtime.Remoting.RemotingException: The argument
type '29.08.2009 21:23:04' cannot be converted into parameter type
'System.Int32'.
---> System.InvalidCastException: Invalid cast from 'DateTime' to 'Int32'.
   at System.DateTime.System.IConvertible.ToInt32(IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvi
er provider)
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt

   --- End of inner exception stack trace ---

Server stack trace:
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt

   at System.Object.FieldSetter(String typeName, String fieldName, Object val)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage
IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInCon
ext, Object[]& outArgs)
  at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
age msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
sg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
a, Int32 type)
  at System.Object.FieldSetter(String typeName, String fieldName, Object val)
  at T.Main()



It seems that the AmbiguousMemberException is only thrown when generic members
are involved.

-- 
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