.NET remoting - using code config works / using config does not ( butlistening )

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotrekk

    .NET remoting - using code config works / using config does not ( butlistening )

    Hi

    I have a strange problem. Here is some input data before I describe
    the problem.
    1. RemoteClass (Mathematica) is compiled into dll and put to GAC
    2. Server remoting configuration is done by code.


    //used in case of code configuration
    TcpChannel channel = new TcpChannel(5000 );
    ChannelServices .RegisterChanne l(channel);
    RemotingConfigu ration.Register WellKnownServic eType(typeof(Re moteClass.Mathe matica),
    "Mathematic a", WellKnownObject Mode.

    // used in case of config file
    //RemotingConfigu ration.Configur e("RemoteHost.e xe.config",fals e);


    As a result client is able to create objects ( singleton ) when
    configured both, by code and configuration file.
    The problem arises when I am trying to configure server remoting using
    config file. The client is unable to create any objects. Client throws
    an exception:

    An unhandled exception of type 'System.IO.File NotFoundExcepti on'
    occurred in mscorlib.dll Additional information: Could not load file
    or assembly 'RemoteClass' or one of its dependencies. The system
    cannot find the file specified.

    I have managed to observe that when I use config file.
    RemotingConfigu ration.GetRegis teredWellKnownS erviceTypes()
    [0].ObjectType is null, while using code configuration this property
    contains some usefull information.

    What I am doing wrong?

    Here is the configuration file of the server:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuratio n>
    <system.runtime .remoting>
    <application name="">
    <service>
    <!--<activated type="RemoteCla ss.Mathematica, RemoteClass"/>--
    >
    <wellknown mode="Singleton " type="RemoteCla ss.Mathematica,
    RemoteClass" objectUri="Math ematica"/>
    </service>
    <channels>
    <channel ref="tcp" port="5000">
    <serverProvider s>
    <formatter ref="binary" typeFilterLevel ="Full"/>
    </serverProviders >
    <clientProvider s>
    <formatter ref="binary"/>
    </clientProviders >
    </channel>
    </channels>
    </application>
    </system.runtime. remoting>
    </configuration>

    Kind Regards
    Piotr Kolodziej
  • Piotrekk

    #2
    Re: .NET remoting - using code config works / using config does not (but listening )

    It seems that the error was caused by NOT specifying assembly version
    and token in the server configuration file. But why i do not need to
    specify this in case of <activated>?

    Comment

    Working...