[Mono-bugs] [Bug 81554][Wis] New - Wrong Method Called via Remoting with Explicit Interface Implementation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon May 7 15:08:51 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by joncham at gmail.com.


--- shadow/81554	2007-05-07 15:08:51.000000000 -0400
+++ shadow/81554.tmp.2670	2007-05-07 15:08:51.000000000 -0400
@@ -0,0 +1,90 @@
+Bug#: 81554
+Product: Mono: Runtime
+Version: 1.0
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: remoting
+AssignedTo: lluis at ximian.com                            
+ReportedBy: joncham at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Wrong Method Called via Remoting with Explicit Interface Implementation
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+When calling a remote method that is on an explicitly implemented interface
+in the presence of another method of the same name, an InvalidCastException
+is thrown.
+Steps to reproduce the problem:
+1. Run attached sample
+Actual Results:
+System.InvalidCastException: Return argument has an invalid type.
+   at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object
+arg, Ty
+pe paramType)
+   at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage
+msg, Object[] outArgs, Object returnValue)
+   at
+System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
+Msg, IMessage retMsg)
+   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
+ta, Int32 type)
+   at Common.ISayHello.SayHello()
+   at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and
+gs\tmilntho\My Documents\Visual Studio
+Application1\Program.cs:line 24
+Expected Results:
+Console output of: Hello
+How often does this happen? 
+Additional Information:
+Also, note that if I change the method of the same name as the explicitly
+implemented method
+public byte[] SayHello()
+public byte[] SayHelloABC()
+I still get an InvalidCastException, although with a different stack trace:
+System.InvalidCastException: Return value has an invalid type
+  at System.Runtime.Remoting.Proxies.RealProxy.ProcessResponse
+sage mrm, System.Runtime.Remoting.Messaging.MonoMethodMessage call) [0x00000]
+  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
+oting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc,
+& out_args) [0x00000]

More information about the mono-bugs mailing list