By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

Windows Service as Remoting Host: Requested Service Not Found

P: n/a
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>
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Fadi,

In the Windows Service, where are you creating the remote object? How about
code snippets of the service.

"Fadi" <fs******@ade.com> wrote in message
news:b1*************************@posting.google.co m...
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>

Nov 16 '05 #2

P: n/a
Hi Steve,

Thanks for the reply. The Windows Service (ComponentsService.exe)
simply calls:

protected override void OnStart(string[] args)
{
string remConfig =
System.AppDomain.CurrentDomain.SetupInformation.Ap plicationBase +
"ComponentsService.exe.config";
RemotingConfiguration.Configure(remConfig);
}

The client app simply uses 'new' to create and comm with the remoted
objects.

Note that this works perfectly the the Host is a Win Forms EXE (which
i have to deliberately launch before the remote objects it hosts can
be accessed by the client)

Thanks

"Steve Lutz" <sl*********@comcast.net> wrote in message news:<#e**************@TK2MSFTNGP10.phx.gbl>...
Fadi,

In the Windows Service, where are you creating the remote object? How about
code snippets of the service.

"Fadi" <fs******@ade.com> wrote in message
news:b1*************************@posting.google.co m...
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>

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.