473,761 Members | 10,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 InitializeLifet imeService() 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.Conf ig:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<client>
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " url="tcp://localhost:8005/LaserDoorServer " />
</client>

<client>
<wellknown type="MyCompone nts.LaserShutte rServer, LaserShutter"
mode="Singleton " url="tcp://localhost:8005/LaserShutterSer ver" />
</client>
<channels>
<channel ref="tcp" />
</channels>
</application>
</system.runtime. remoting>
</configuration>
The HostService.exe .config:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<service>
<activated type="MyCompone nts.LaserDoorSe rver, LaserDoor" />
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " objectUri="Lase rDoorServer" />
</service>

<service>
<activated type="MyCompone nts.LaserShutte rServer, LaserShutter" />
<wellknown type="MyCompone nts.LaserShutte r, LaserShutter"
mode="Singleton " objectUri="Lase rShutterServer" />
</service>

<channels>
<channel ref="tcp" port="8005" />
</channels>
</application>
</system.runtime. remoting>
</configuration>
Nov 16 '05 #1
2 7277
Fadi,

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

"Fadi" <fs******@ade.c om> wrote in message
news:b1******** *************** **@posting.goog le.com...
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 InitializeLifet imeService() 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.Conf ig:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<client>
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " url="tcp://localhost:8005/LaserDoorServer " />
</client>

<client>
<wellknown type="MyCompone nts.LaserShutte rServer, LaserShutter"
mode="Singleton " url="tcp://localhost:8005/LaserShutterSer ver" />
</client>
<channels>
<channel ref="tcp" />
</channels>
</application>
</system.runtime. remoting>
</configuration>
The HostService.exe .config:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<service>
<activated type="MyCompone nts.LaserDoorSe rver, LaserDoor" />
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " objectUri="Lase rDoorServer" />
</service>

<service>
<activated type="MyCompone nts.LaserShutte rServer, LaserShutter" />
<wellknown type="MyCompone nts.LaserShutte r, LaserShutter"
mode="Singleton " objectUri="Lase rShutterServer" />
</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 (ComponentsServ ice.exe)
simply calls:

protected override void OnStart(string[] args)
{
string remConfig =
System.AppDomai n.CurrentDomain .SetupInformati on.ApplicationB ase +
"ComponentsServ ice.exe.config" ;
RemotingConfigu ration.Configur e(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*********@co mcast.net> wrote in message news:<#e******* *******@TK2MSFT NGP10.phx.gbl>. ..
Fadi,

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

"Fadi" <fs******@ade.c om> wrote in message
news:b1******** *************** **@posting.goog le.com...
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 InitializeLifet imeService() 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.Conf ig:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<client>
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " url="tcp://localhost:8005/LaserDoorServer " />
</client>

<client>
<wellknown type="MyCompone nts.LaserShutte rServer, LaserShutter"
mode="Singleton " url="tcp://localhost:8005/LaserShutterSer ver" />
</client>
<channels>
<channel ref="tcp" />
</channels>
</application>
</system.runtime. remoting>
</configuration>
The HostService.exe .config:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application>
<service>
<activated type="MyCompone nts.LaserDoorSe rver, LaserDoor" />
<wellknown type="MyCompone nts.LaserDoorSe rver, LaserDoor"
mode="Singleton " objectUri="Lase rDoorServer" />
</service>

<service>
<activated type="MyCompone nts.LaserShutte rServer, LaserShutter" />
<wellknown type="MyCompone nts.LaserShutte r, LaserShutter"
mode="Singleton " objectUri="Lase rShutterServer" />
</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
2267
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
8989
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 Remote object method is invoked, following error happens
1
321
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 the new project ) Build with no error, use installutil to register it to Services. (Success) However, I can't not start this services. Error 1083 : the executable program that this service is configured to run
0
1049
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 the new project ) Build with no error, use installutil to register it to Services. (Success) However, I can't not start this services. Error 1083 : the executable program that this service is configured to run
3
4795
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 ServiceController to check that the Service on the specified machine is running, can I get the DataSet that is held within the Service? Is it possible to create Properties or have a function that returns the DataSet? Kind Regards,
1
1599
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 service. Using the ServiceController class, I see that it is easy to get a limited amount of information INTO a service (such as using Custom Commands). Now let's reverse that - How does one get information OUT of a Windows service? For...
2
3975
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 other one is a .NET control deploy by a tag object. All assemblies are signed with a Strong Name. For the kind of deploy (by IE) and the use of remoting technology I
0
8278
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 the console application to WinForms and also got that to work properly. My next move was to host the WCF service in a Windows service application. I believe I have that working correctly, but I can't for the life of me get a client to connect...
7
2281
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 shows messages from the service. Can I do that with remoting? What are the main steps to do that? --
0
9521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9333
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9900
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8768
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.