By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,638 Members | 2,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,638 IT Pros & Developers. It's quick & easy.

Remoting serialization exception??

P: 1
I'm working on a remoting application where the client only references interfaces for all wellknown objects.

I currently have an object, Request being exposed:
Expand|Select|Wrap|Line Numbers
  1. Imports System.Runtime.Remoting
  2. Imports System.Runtime.Remoting.Channels
  3. Imports System.Runtime.Remoting.Channels.http
  4. Imports Central.Remotable
  6. Public Class SyncService
  8.    Protected Overrides Sub OnStart(ByVal args() As String)
  9.       Dim provider As New BinaryServerFormatterSinkProvider()
  10.       provider.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
  12.       Dim props As New Hashtable()
  13.       props("port") = 8989
  15.       Dim channel As HttpServerChannel = New HttpServerChannel(props, provider)
  16.       ChannelServices.RegisterChannel(channel, False)
  18.       RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off
  19.       RemotingConfiguration.RegisterWellKnownServiceType(GetType(Request), "Request", WellKnownObjectMode.Singleton)
  20.    End Sub
  22.    Protected Overrides Sub OnStop()
  23.    End Sub
  25. End Class
And my client is configured (using XML) as so:
Expand|Select|Wrap|Line Numbers
  1.   <system.runtime.remoting>
  2.     <application>
  3.       <channels>
  4.         <channel ref="http">
  5.           <clientProviders>
  6.             <formatter ref="binary" typeFilterLevel="Full" />
  7.           </clientProviders>
  8.         </channel>
  9.       </channels>
  10.       <client>
  11.         <wellknown 
  12.           type="Central.Interface.Remotable.IRequest, Central.Interface"
  13.           url="http://localhost:8989/Request"
  14.          />
  15.       </client>
  16.     </application>
  17.   </system.runtime.remoting>
The problem I'm running into is the Request object returns a structure in Central.Common.Structs that implements an interface in Central.Interface. The client ONLY has a reference to the Central.Interface class library and not the Central.Common. When I run the method on Request that returns the structure, I get a SerializationException telling me that it cannot find the assembly Central.Common. Why would that exception be thrown when the client only points to the interface and expects an object of Central.Interface.Structs.IStartReturnStruct?

If you need any more code/details, let me know. I posted a ton already and didn't want to clutter this up any more.

Sep 25 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.