472,958 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Remoting - WIndows Service problem

Hi ,
Sorry i am posting this again as no one seems have taken notice of this
in the distributed appln forum

I have a remote server which works fine. The Client ans server work with
no problem.

However when i convert the server to a windows service i run into problems.
The service installs fine and starts fine too. It also seems to register the
channels and create the well know types.

However when i try to access the server using the client it throws an
"Exception has been thrown by the target of an invocation." This is
precisely thrown when the proxy object on the client tries to access a
property or method from the remote server. The server itself does not throw
any errors.

Below is the server code for OnStart.

Please can someone give me any clues of what could be happening?

protected override void OnStart(string[] args)
// TODO: Add code here to start your service.

fs = new StreamWriter(new
System.IO.FileStream("C:\\temp\\mcTest.txt",FileMo de.Append ));

BinaryServerFormatterSinkProvider provider = new
provider.TypeFilterLevel = TypeFilterLevel.Full;

IDictionary props = new Hashtable();
props["port"] = 8085;
TcpChannel myChannel = new TcpChannel(props, null, provider);

//register channel

//Register services
RemotingConfiguration.ApplicationName = "AServer";
RemotingConfiguration.Configure(System.AppDomain.C urrentDomain.BaseDirectory.ToString() + "AServer.exe.config");
RemotingConfiguration.RegisterWellKnownServiceType (

catch(Exception err)
if (fs !=null)

fs = new StreamWriter(new
System.IO.FileStream("C:\\temp\\mcTest.txt",FileMo de.Append));
fs.WriteLine(err.Message );

fs = new StreamWriter(new
System.IO.FileStream("C:\\temp\\mcTest.txt",FileMo de.Append));
fs.WriteLine("finally" );


Was this post helpful to you?

Why should I rate a post?

Expand AllCollapse All
Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
Aug 16 '06 #1
1 1249
A Windows Service does not run in the same namespace.
Aug 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Linesh Gajera | last post by:
Hi, I have unique problem. I have configured RemotingServer running as Console Application and my Remoting object access Oracle database. My remoting object make call to Oracle database and...
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"...
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...
by: Mural Kumar via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Mural Kumar Which is the best way to make a remoting server? 1)As a Windows service 2)As a simple exe, which will run in a...
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...
by: Stephajn Craig | last post by:
Is it possible to apply remoting techniques to a Windows Service Application? I have an application that I'm building that is primarily ASP.NET based. However, there are some functions that I...
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
by: Jason | last post by:
Ok, for the life of me, I just don't understand what's going on. I want to use remoting to send messages from a windows service to a windows form app, but I just can't get it to work. So, here's...
by: nyhetsgrupper | last post by:
I have written a windows service and want to expose a web based user interface for this service. I then wrote a class library containing a ..net remoting server. The class library have a method...
by: Josť Joye | last post by:
Hello, What is the best way to stop a remoting server (Singleton SAO) that has been started with RemotingConfiguration.Configure(). For sure, I want to do this without quitting the application...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.