CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    5

    Remoting Serialization problem

    Hi!

    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

    Code:
       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), "http://127.0.0.1:" & pServicePortNumber.ToString & "/" & pServiceName), MMOutlookSyncServer.clsSyncControler)
    In the second program say, Program "B", I simply instantiate the class SyncControler to the already registered one
    Code:
     oSyncControler = CType(Activator.GetObject(GetType(MMOutlookSyncServer.clsSyncControler), "http://127.0.0.1:" & 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"
    Code:
     Me.DataGridView1.DataSource = oSyncControler.SyncLog
    give me this error:
    Code:
    Parse Error, no assembly associated with Xml key a2:http://schemas.microsoft.com/clr/nsassem/MMOutlookSyncServer/MMOutlookSyncServer%2C%20Version%3D8.3.104.3%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3De6d769c29d13d867 dsSyncLog
    A another method that I've try
    Code:
    oSyncControler.WriteSyncHeader("Remoting sync controler started on TCP port :" & pServicePortNumber.ToString, MMOutlookSyncServer.clsSyncControler.eSyncResult.Message)
    give me this error:
    Code:
    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

    Hugo

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

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    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
  •  





Click Here to Expand Forum to Full Width

Featured