473,387 Members | 1,590 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,387 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 7256
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.