dotnet remoting:
How to expose two different objects via .NET Remoting?
Hello,
I am trying to do the following:
Exposing Obj1 and Obj2 via ProcessA
Conects to obj1 from Client1 and connect Obj2 from Client2
both Objects has events.
Obj1 is implemented in ProcessA
Obj2 is implemented in DLL.
The DLL is referencedin ProcessA
When I expose only one object the server starts well and the
corresponded client work with it great.
When I try to expose them both
The first Configure call , of obj2, succeeded:
RemotingConfiguration.Configure("LogManagerRemoting.config");
I receive the following exception in the second Configure call:
RemotingConfiguration.Configure ("nvAppServer.exe.config");
Ex:
{"Remoting configuration failed with the exception
System.Runtime.Remoting.RemotingException: The remoting application
name, ServerAssembly, had already been set.\r\n at
System.Runtime.Remoting.RemotingConfigHandler.set_ApplicationName(String
value)\r\n at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData
configData)." }
My configuration
Obj2
config file:
<system.runtime.remoting>
<application name="ServerAssembly" >
<customErrors mode="off"/>
<service>
<wellknown mode="Singleton"
type="NiceVision.Common.LogManager.LogManagerEventSharedObj,
LogManager" objectUri="LogManagerUID" />
</service>
<channels>
<channel ref="tcp" port="64545">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
<lifetime leaseTime="3D" sponsorshipTimeout="1H"
renewOnCallTime="1D" leaseManagerPollTime="1H" />
</application>
</system.runtime.remoting>
obj1
Config file
<system.runtime.remoting>
<application name="nvAppServer" >
<customErrors mode="off"/>
<service>
<wellknown mode="Singleton"
type="NiceVision.ApplicationServer.ServiceInterfaces.ApplicationServerAPI,
nvAppServer" objectUri="ApplicationServer" />
</service>
<channels>
<channel ref="tcp" port="65100">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
<lifetime leaseTime="3D" sponsorshipTimeout="1H"
renewOnCallTime="1D" leaseManagerPollTime="1H" />
</application>