Backround:
I am trying to figure out how to do the equivalant of a classic COM
Local Server Singleton in .NET/C#. I created a coupld of simple Class
Libs that exposes public interfaces and hosted them in a Windows Forms
EXE. Create a Windows Forms client and both the Client and the Host
EXEs configure the remoting protocols through respective .config
files.
Problem:
I want to change the host from an Win Forms EXE to a Windows Service.
The Windows Service is build and installed and I can start it
successfully but i am unable to communicate with the objects it hosts!
I get the error: "Requested Service Not Found".
I override InitializeLifetimeService() in both hosted objects to
return 'null' so the lease never expires, but w/o success in resolving
this error.
Thanks in advance...
Client.exe.Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="MyComponents.LaserDoorServer, LaserDoor"
mode="Singleton" url="tcp://localhost:8005/LaserDoorServer" />
</client>
<client>
<wellknown type="MyComponents.LaserShutterServer, LaserShutter"
mode="Singleton" url="tcp://localhost:8005/LaserShutterServer" />
</client>
<channels>
<channel ref="tcp" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
The HostService.exe.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<activated type="MyComponents.LaserDoorServer, LaserDoor" />
<wellknown type="MyComponents.LaserDoorServer, LaserDoor"
mode="Singleton" objectUri="LaserDoorServer" />
</service>
<service>
<activated type="MyComponents.LaserShutterServer, LaserShutter" />
<wellknown type="MyComponents.LaserShutter, LaserShutter"
mode="Singleton" objectUri="LaserShutterServer" />
</service>
<channels>
<channel ref="tcp" port="8005" />
</channels>
</application>
</system.runtime.remoting>
</configuration>