CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    May 2005
    Posts
    178

    Unhappy need help with config file

    i have a remote object in the server side which implements an interface that declared in a dll.
    something like that:

    DLL-
    interface Iremote{..}

    Server Side-
    class RemoteClass implements Iremote{..}

    Client Side-
    //connect to server
    //Activator.GetObject --> typeof Iremote!!


    till now everything is ok
    now im trying to put it in a configuration file:

    <service>
    <wellknown mode="Singleton"
    type="ServerSide.RemoteClass ,ServerSide" />
    </service>

    but what should i write in the "type"??
    i know ServerSide.RemoteClass is wrong,
    the type supposed to be - new RemoteClass().GetType()
    but how to write that in the config?

    thanks in advanced

  2. #2
    Join Date
    Jul 2005
    Posts
    1

    Re: need help with config file

    I assume that the config file is on the client side. So since ServerSide.RemoteClass implements the interface IRemote you can simply write:

    <service>
    <wellknown mode="Singleton"
    type="<IRemoteNamespace>.IRemote, <IRemoteNamespace>" />
    </service>

    Where <IRemoteNamespace> is the namespace of the IRemote interface.
    Hope this works for you.
    Mario

  3. #3
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    actually the config file is on the server side
    so i tried that-
    <service>
    <wellknown mode="Singleton" type="IRemoteNamespace.IRemote,IRemoteNamespace" objectUri="Server.rem"/>
    </service>

    but its not working.
    what else can it be?
    thanks

  4. #4
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    plz..plz..plz..
    anyone?

  5. #5
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    Don't know any specifics but the following links may give you more background information

    .NET Remoting FAQ

    (Maybe) in particular: HOWTO: Use Interface-based remote objects with config files
    Useful? Then click on (Rate This Post) at the top of this post.

  6. #6
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    thanks but id didnt found there what i need...
    any more ideas?

  7. #7
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    I for one find it diificult to debug code I cannot see...

    Any chance you can post the client, server and shared library code, as well as the client and server config files?
    Useful? Then click on (Rate This Post) at the top of this post.

  8. #8
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    ok, here is the code-
    //class library
    public interface IRemoteObject
    {
    Guid register();
    }

    //client side(inside main)
    TcpChannel chan=new TcpChannel();
    ChannelServices.RegisterChannel(chan);
    IRemoteObject obj=(Library.IRemoteObject)Activator.GetObject(typeof(Library.IRemoteObject),"tcp://localhost:8085/Server");
    Guid id=obj.register();

    //server side(inside main)
    RemotingConfiguration.Configure("ServerSide.exe.config");

    //server side (config)
    <system.runtime.remoting>
    <application>
    <channels>
    <channel name="channel1" ref="tcp" port="8085"></channel>
    </channels>
    <service>
    <wellknown mode="Singleton" type="ServerSide.TasksManagement,ServerSide" objectUri="ServerSide.rem"/>
    </service>
    </application>
    </system.runtime.remoting>

    //server side(remote object)
    public class TasksManagement: MarshalByRefObject,IRemoteObject
    {
    public Guid register()
    { return System.Guid.NewGuid();
    }
    }

  9. #9
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    Quick guess: Shouldn't "tcp://localhost:8085/Server" match your server config ie. "tcp//localhost:8055/ServerSide.rem" ?
    Useful? Then click on (Rate This Post) at the top of this post.

  10. #10
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    ok so i changed it in the server side to-
    IRemoteObject obj=(Library.IRemoteObject)Activator.GetObject(typeof(Library.IRemoteObject),"tcp://localhost:8085/ServerSide/TasksManagement.rem");

    and in he config on the server side i wrote-
    <wellknown mode="Singleton" type="ServerSide.TasksManagement,ServerSide" objectUri="TasksManagement.rem"/>

    but it still not working...

  11. #11
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    This is still wrong:
    "tcp://localhost:8085/ServerSide/TasksManagement.rem"

    Should be:
    "tcp://localhost:8085/TasksManagement.rem"

    This may still not work but it definitely won't work with such obvious mistakes.
    Useful? Then click on (Rate This Post) at the top of this post.

  12. #12
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    PS. I assume your server code actually is
    Code:
    RemotingConfiguration.Configure("ServerSide.exe.config");
    Console.ReadLine();
    Useful? Then click on (Rate This Post) at the top of this post.

  13. #13
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    yes

  14. #14
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: need help with config file

    Working now then?
    Useful? Then click on (Rate This Post) at the top of this post.

  15. #15
    Join Date
    May 2005
    Posts
    178

    Re: need help with config file

    still not working

Page 1 of 2 12 LastLast

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