How to configure client in Remoting example

Posts   
 
    
Ceres
User
Posts: 20
Joined: 31-Jan-2007
# Posted on: 01-Mar-2008 17:58:41   

Hi,

I'm using Adapter 2.5 and have returned to doing some more testing based on LLBLGen's Remoting example. I've extracted the Server registration code into its app.config and that works ok. I could do with some advice on doing the equivalent for the Client and its own config file.

First, I can add keys to the client's app.config for url details and Servername then in Startup.cs, just get those values from its config and change the MarshalByRefObject line to:

MarshalByRefObject o = (MarshalByRefObject)RemotingServices.Connect(typeof(IService), string.Format(URLREMOTECONFIG, SERVERNAME));

This works fine, but I would like to extract channel details as well but I can't get it defined correctly. Here's what I have:

Client app.config:

<configuration>
  <appSettings>
    <add key="ServerName" value="localhost"/>
  </appSettings>
  <system.runtime.remoting>
    <application name="Northwind.GUI">
      <client>
        <wellknown type="RemotingService.Service" url="tcp://localhost/theEndPoint" />
      </client>
      <channels>
        <channel ref="tcp client" port="65100" />
      </channels>
    </application>
  </system.runtime.remoting>
</configuration>

Startup.cs

RemotingConfiguration.Configure("Northwind.GUI.exe.config", true);

MarshalByRefObject o = (MarshalByRefObject)RemotingServices.Connect(typeof(IService), **what do I put here**);

How do I define the 2nd parameter of RemotingServices.Connect ie. how do I get the url details from the config file without using config keys?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 03-Mar-2008 10:49:48   

I don't know the answer to your question, but is this an LLBLGen issue? If not, then it should have been posted in another forum like the general forum.

Ceres
User
Posts: 20
Joined: 31-Jan-2007
# Posted on: 03-Mar-2008 10:58:10   

Ok. Fair enough