473,241 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Windows Service as Remoting Host: Requested Service Not Found

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
2 7245
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Michael Riggio | last post by:
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP? Thanks, -Mike
1
by: vijay | last post by:
Hello I am learnign Dot NEt I have implemted 1. remote object 2.Listener 3.Client Listener started and listening to requests Client started and able to nstantiate remote object But when a...
1
by: Vuong | last post by:
I just wrote a simple host application. Already tested. After that i change it to a service. (I add new project to the exist host application, copy code from this host application to OnStart() of...
0
by: Vuong | last post by:
I just wrote a simple host application. Already tested. After that i change it to a service. (I add new project to the exist host application, copy code from this host application to OnStart() of...
3
by: Steve Amey | last post by:
Hi all Is it possible to retrieve data from a Windows Service? Let's say I have a service that contains code in the OnStart method that creates a DataSet, from a client application I'm using a...
1
by: Tom | last post by:
I am writing a Windows service in VB.NET... I am using two applicatons - the actual service, and then an additional 'control app' (Windows Forms) that can be used to stop, start, monitor, etc the...
2
by: Lambuz | last post by:
Hi all, I've got this terrible problem. I'm deploying 2 different .NET application (Framework .NET 1.1) that both use remoting technology, but one is a HREF no-touch-deploy smart client and the...
0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported...
7
by: Diego F. | last post by:
Hello. I have a windows service running that listens to a port and makes insert queries in a database. I need to make an interface, so my idea is creating a simple windows application that just...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.