473,386 Members | 1,720 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,386 software developers and data experts.

.NET Remoting :: Requested Service Not Found

Airslash
221 100+
Hello,

I'm making a Windows Service that runs in the background and handles the .NET Remoting part on the server. This is the code currently available for my service when it starts.

Expand|Select|Wrap|Line Numbers
  1. protected override void OnStart(string[] args)
  2.         {
  3.             // Write in the EventLog of Windows that the remote service for BigBrother is starting.
  4.             EventLog.WriteEntry("BigBrother Remote Service -- Starting up the Service.");
  5.  
  6.             // Create a new TCP channel for our service to listen on.
  7.             TcpChannel channel = new TcpChannel(3000);
  8.             EventLog.WriteEntry("BigBrother Remote Service -- Channel created on port 3000");
  9.  
  10.             // Register the channel so clients can remote access it.
  11.             ChannelServices.RegisterChannel(channel, true);
  12.             EventLog.WriteEntry("BigBrother Remore Service -- Channel registered.");
  13.  
  14.             // Register our RemoteManager class so clients can talk to it and perform
  15.             // tasks.
  16.             try
  17.             {
  18.                 WellKnownServiceTypeEntry srvcEntry = new WellKnownServiceTypeEntry(typeof(RemoteManager), "tcp://localhost:3000/BigBrotherRemoteService", WellKnownObjectMode.SingleCall);
  19.                 RemotingConfiguration.RegisterWellKnownServiceType(srvcEntry);
  20.                 EventLog.WriteEntry("BigBrother Remote Service -- Listener successfully registered.");
  21.             }
  22.             catch (Exception Ex)
  23.             {
  24.                 EventLog.WriteEntry("BigBrother Remote Service -- Failed to register the Listener :: " + Ex.ToString());
  25.             }
  26.         }
  27.  
This is the code of the object beeing made avaialble for remoting:
Expand|Select|Wrap|Line Numbers
  1. public class RemoteManager : MarshalByRefObject
  2.     {
  3.         public RemoteManager()
  4.         { }
  5.  
  6.         public String Test()
  7.         {
  8.             return "Remote Manager greets you.";
  9.         }
  10.     }
  11.  
and this is the code that I'm using in the client application to connect to the service and try to execute the Test() method.

Expand|Select|Wrap|Line Numbers
  1. static void Main(string[] args)
  2.         {
  3.             // Create a channel for communicating with the remote object.
  4.             TcpChannel channel = new TcpChannel();
  5.             ChannelServices.RegisterChannel(channel, true);
  6.  
  7.             // Create an instance of the remote object.
  8.             BigBrother_Remote_Library.RemoteManager manager = (BigBrother_Remote_Library.RemoteManager)Activator.GetObject(typeof(BigBrother_Remote_Library.RemoteManager), "tcp://localhost:3000/BigBrotherRemoteService");
  9.  
  10.             // Use the object.
  11.             if (manager.Equals(null))
  12.             {
  13.                 System.Console.WriteLine("Failed to retrieve the remote object.");
  14.             }
  15.             else
  16.             {
  17.                 System.Console.WriteLine("Calling the Test function on our object.");
  18.                 System.Console.WriteLine(manager.Test());
  19.             }
  20.  
  21.             System.Console.ReadLine();
  22.         }
  23.  
the code of the object in question is located inside a DLL file and has been referenced from the other projects. The code compiles but when I execute the client I recieve : The Requested Service cannot be found.

What am I doing wrong/forgetting?
Mar 2 '10 #1
0 1798

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: anders | last post by:
Hi! I have a config file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application> <service> <wellknown mode="SingleCall"...
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...
3
by: Steve Lutz | last post by:
Hi All, I have a Windows Service that runs well. The service hosts a remote object. The purpose of the object is so that I can "peak" into the service to see what it's doing. I wrote a small...
2
by: Fadi | last post by:
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...
7
by: Sharon | last post by:
Hi, I wrote a remoting object and published it like this: public class RemoteLogger : MarshalByRefObject { // Contain some methods... } public class RemoteManager
0
by: Jean-Pierre Fouche | last post by:
I have a server app which hosts a remote object, published via http. The app works fine as a self-standing .exe. However, when I host the same code as a library .dll, the object is unavailable...
5
by: LGHummel | last post by:
I'm trying to host a remoting app in IIS and am getting the following error: Failed to execute the request because the ASP.NET process identity does not have read permissions to the global...
4
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
0
by: Dave A | last post by:
When I register a remoting service programmatically things work great but when I register the service using a config file I get the error "Requested Service not found" when invoking a server...
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.