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

P

Piotrekk

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.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteClass.Mathematica),
"Mathematica", WellKnownObjectMode.

// used in case of config file
//RemotingConfiguration.Configure("RemoteHost.exe.config",false);


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.FileNotFoundException'
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.
RemotingConfiguration.GetRegisteredWellKnownServiceTypes()
[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" ?>
<configuration>
<system.runtime.remoting>
<application name="">
<wellknown mode="Singleton" type="RemoteClass.Mathematica,
RemoteClass" objectUri="Mathematica"/>
</service>
<channels>
<channel ref="tcp" port="5000">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>

Kind Regards
Piotr Kolodziej
 
P

Piotrekk

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>?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top