Return argument has an invalid type - does remoting work reliably at all?
From: Martin Schmidt (ano_at_nym.de)
Date: 03/04/05
- Next message: Ian Armitage: "TCPChannel - Socket Error"
- Previous message: Mahesh Devjibhai Dhola: "Help - P2P connection in .Net - like Yahoo does for IM"
- Next in thread: Fred Hirschfeld: "Re: Return argument has an invalid type - does remoting work reliably at all?"
- Reply: Fred Hirschfeld: "Re: Return argument has an invalid type - does remoting work reliably at all?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 04 Mar 2005 01:52:22 -0800
feng wrote in 'How to debug between my calling code and remote code?' :
> I am getting error between my local code, that's making call to a
> remote object, and the called remote code. The error occoured after my
> remote object returns (I can debug to that point. And it shows the
> returned reference correctly) and before my calling code gets the
> returned reference back.
>
> The error says that the "Return argument has an invalid type". But it
> only happens in some cases, not always. Looks like it is the
> stub/skeleton throwing the error, but how do I debug this? Is there
> are a way I can debug into the stub/skeleton code? I need to know
> what's going on in there in order to fix the problem.
I am having exactly the same problem and I am running mad.
Setup:
-binary tcp channel, server resides in a console app (to be moved to a service
later)
-the shared assembly with interfaces and EventWrappers is used by client
and server
-interfaces in this assembly (simplified): IItem, IFactory
IFactory has a method 'IItem GetItem(string ip);'.
-Implementations of IItem and IFactory are derived by MarshalByRefObject,
IFactory is
server activated singleton through RemotingServices.Marshal, instanciated
on client
with RemotingHelper class from Ingo Rammer (http://www.thinktecture.com)
Problem:
Calling GetItem raises the exception "Return argument has an invalid type".
It does so, even when I change the signature of GetItem().
Returning strings works ok, but returning e.g. just the IFactory itself or
a normal MarshalbyRef-class (defined in the shared assembly) raises again
this error:
Return argument has an invalid type.
System.InvalidCastException
at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object
arg, Type paramType)
at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage
msg, Object[] outArgs, Object returnValue)
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at Interfaces.IFactory.GetItem(String sIPAddress)
Knowledge input:
"Advanced .Net Remoting" by Ingo Rammer, his website, msdn, articles on
www.genuinechannels.com.
It's incredible. In my little remoting test application using interfaces
and events etc. the same way worked ok (after a long time struggling). Now
I'm starting to write production code I run into this. Any idea?
Probable solution: get rid of remoting
.Net Remoting is really a pain to work with. Working configurations are extremely
fragile. I just need reasonable interprocess communication, no web or IIS
involved. Just two processes, one constantly running in background collecting
data and the other one is a seperatly started GUI. COM is reliable and working
and I probably will have to use COM interop to communicate between my two
.Net processes. Isn't this mad?
.Net is really great, but I start to understand, why there is still no .Net
integration (compare with COM) even with the Microsoft apps like Office or
VS. Remoting just sucks. Its serialization is the only good thing about it.
Does anyone really use .Net Remoting happily in a real world application
(just on the same host is ok) without web or IIS?
Any hints are greatly appreciated.
Martin.
- Next message: Ian Armitage: "TCPChannel - Socket Error"
- Previous message: Mahesh Devjibhai Dhola: "Help - P2P connection in .Net - like Yahoo does for IM"
- Next in thread: Fred Hirschfeld: "Re: Return argument has an invalid type - does remoting work reliably at all?"
- Reply: Fred Hirschfeld: "Re: Return argument has an invalid type - does remoting work reliably at all?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|