https://bugzilla.novell.com/show_bug.cgi?id=354926


           Summary: Remoting class implementing interface type throws
                    RemotingException in client and client fails
           Product: Mono: Runtime
           Version: 1.2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: remoting
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: Development


Created an attachment (id=191069)
 --> (https://bugzilla.novell.com/attachment.cgi?id=191069)
Source code and NAnt build file for repro

I have a sample application (see attachment) consisting of a server, client and
a shared component. I declare an interface in the shared component. The server
defines class implementing this interface and the client tries to get an
instance of the remoted object through the interface.

This results in the following exception being thrown in the client:

System.Runtime.Remoting.RemotingException: Cannot cast from client type
'Trac79.Shared.IRemoteObject, Shared, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' to server type 'Trac79.Server.RemoteObject'

Server stack trace:
  at System.Runtime.Remoting.Messaging.MethodCall.ResolveMethod () [0x00000]
  at System.Runtime.Remoting.Messaging.MethodCall..ctor
(System.Runtime.Remoting.Messaging.Header[] headers) [0x00000]
  at
System.Runtime.Serialization.Formatters.Binary.MessageFormatter.ReadMethodCall
(System.IO.BinaryReader reader, Boolean hasHeaders,
System.Runtime.Remoting.Messaging.HeaderHandler headerHandler,
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter)
[0x00000]
  at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
  at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage
(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
requestHeaders, System.IO.Stream requestStream, IMessage& responseMsg,
ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000]

Exception rethrown at [0]:

  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception&
exc, System.Object[]& out_args) [0x00000]

Remoting an interface like this is supported by the CLR and does not result in
this exception.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to