Remoting Serialization problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Remoting Serialization problem

  1. #1
    Join Date
    Aug 2008

    Remoting Serialization problem


    I'm kind of new in Remoting domain, and I'm facing some problem,

    I've create a DLL that store a Class that 2 application need,
    One of them say program "A" register and instantiate the "service" like this

       RemoteTcpSetting("port") = pServicePortNumber
       RemoteTcpSetting("name") = pServiceName
       Dim channel As New System.Runtime.Remoting.Channels.Http.HttpChannel(RemoteTcpSetting, Nothing, Nothing)
       If ChannelServices.GetChannel(pServiceName) Is Nothing Then
           ChannelServices.RegisterChannel(channel, False)
       End If
     RemotingConfiguration.RegisterWellKnownServiceType(GetType(MMOutlookSyncServer.clsSyncControler), pServiceName, WellKnownObjectMode.Singleton)
       'Instantiate the service 
       oSyncControler = CType(Activator.GetObject(GetType(MMOutlookSyncServer.clsSyncControler), "" & pServicePortNumber.ToString & "/" & pServiceName), MMOutlookSyncServer.clsSyncControler)
    In the second program say, Program "B", I simply instantiate the class SyncControler to the already registered one
     oSyncControler = CType(Activator.GetObject(GetType(MMOutlookSyncServer.clsSyncControler), "" & pServicePortNumber.ToString & "/" & pServiceName), MMOutlookSyncServer.clsSyncControler)
    All the above work great I can manipulate the oSyncControler member and property perfectly.

    Thing go a bit more problematic, when I bring the code from the program "B" into a Outlook AddIns DLL. Every procedure/method that I call bring error.
    One of them, when I try to get a Typed DataSet from the "service"
     Me.DataGridView1.DataSource = oSyncControler.SyncLog
    give me this error:
    Parse Error, no assembly associated with Xml key a2: dsSyncLog
    A another method that I've try
    oSyncControler.WriteSyncHeader("Remoting sync controler started on TCP port :" & pServicePortNumber.ToString, MMOutlookSyncServer.clsSyncControler.eSyncResult.Message)
    give me this error:
    Invalid method signature 'xsd:string a2:clsSyncControler+eSyncResult'.
    I've read a bit about this problem and it seam that is something to do with Type version or something, and it suggest to do Manual Serialization, or manual type conversion. But I'm note sure if this is really needed, since all file are Local to the computer, and all type should be Known.

    Hope to be clear enough


    PS I'm using VS 2005, Fw 2.0
    Using Visual Studio 2005, Fw 2.x

  2. #2
    Join Date
    Mar 2002
    St. Petersburg, Florida, USA

    Re: Remoting Serialization problem

    Remoting is and always was a bit problematic. Type resolution is only one of the issues. If you can use the NET extensions, you will probably save yourself ALOT of grief by using WCF.

    One pattern that I have found to help with your specific problem is to declare ALL types which exist on both sides of the boundary in a distinct DLL.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)