473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.Net remoting exception: No connection could be made because the target machine actively refused it

In my project I want to execute some commands on the remote machine. I am
using .Net Remoting to achieve this. My server which is an exe is copied on
the remote machine and it receives command from client which is executed by
the exe. I am facing problem while executing the exe on the remote machine.
If I start the exe manually everything works fine but if I execute it
remotely through code using WMI an exception is thrown saying "No connection
could be made because the target machine actively refused it". This
exception is generally thrown when the remote server is not running but the
task manager of the remote machine shows that the exe is running. I am
using Win32_process class to do this. The MSDN help of Win32_process class
Create() method says "For security reasons the Win32_Process.C reate method
cannot be used to start an interactive process". Is this the reason for the
exception? If so, then what is the alternative for executing an exe on
remote machine?

I am pasting the code snippet of my client and server below

Code of Server:

RemotingConfigu ration.Configur e( "rpcserver.exe. config" );

TcpServerChanne l channel = new TcpServerChanne l(rs.mPort);

ChannelServices .RegisterChanne l(channel);

RemotingConfigu ration.Register WellKnownServic eType(

typeof(RemoteSe rverObject),

"ToolComman d",

WellKnownObject Mode.SingleCall );

Code for Client:

ManagementScope obScope = new ManagementScope ("\\\\" + remoteServer +
"\\root\\CIMV2" );

ManagementClass shareClass = new ManagementClass ( "\\\\" + remoteServer +
"\\root\\CIMV2: Win32_Process" );

object[] param = {"c:\\temp\\rpc server.exe",nul l,null,null};

object response = shareClass.Invo keMethod( "Create", param );

}
Nov 16 '05 #1
0 4790

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

Similar topics

0
1368
by: Karuppasamy | last post by:
H I have created a Windows Application using C#. This Windows application makes a call to a Remoting Object which runs as a Windows Service. This Remoting Component makes a call to a Com+(Name : MyComPlusComponent) component. All the Windows application, the Remoting component and the Com+ run in the same Windows 2000 Advanced Server machine....
2
1618
by: MS | last post by:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything...
0
1217
by: Maurice | last post by:
Our product is build using the .NET framework 1.1. We have WinForm application that communicates a server via Remoting (tcp channel). We have two ways communication: From application to server using a singleton remoting connection (using Activator) From server to application using delegate (using delegate wrapper – a simple
5
6281
by: Data | last post by:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from client which is executed by the exe. I am facing problem while executing the exe on the remote machine. If I start the exe manually everything...
1
3421
by: suhas | last post by:
Hi We have .net remoting applications (using .net framework 1.1) I want to implement error handling in much better way to conclude about the problem/failure occurred. What are the standard or Microsoft recommendations when communication fails due to several reasons like Server or Client hangs Server or Client machine is not up
1
1841
by: Derrick | last post by:
Hello all; I'm having a bit of trouble with .NET remoting. Here's my scenario: I have a "remotable" type which is served by a Windows Service. I have a WinForms app which consumes the remotable type. I'm using the Observer pattern, so the client registers with the server, and the server refreshes the client as appropriate (doing it...
5
7693
by: OJ | last post by:
Hi, I am at a loss here, I have a c# asp.net website which connects to a remote SQL Server 2000 db via a connection string. If I set the website up in the filesystem and use the inbuilt cassini webserver in VS2005 then everything is rosy. If I then set up the website on the local IIS 5.1 the site no longer connects and returns this error: ...
0
1044
by: VishalSimon | last post by:
Remoting Error can not access property or method of proxy object on internet, works fine for LAN Hello, here is my some remoting code Code Snippet Remoted Class: namespace Server
3
3737
by: Adhal | last post by:
Hi, I am using remoting to pass in parameters from new launches of an application. So basically I have only one instance of the application and I am using remoting to pass the parameters. The problem is as follows: I can remote call the first few times, but then I get the "No connection could be made because target machine actively...
0
7698
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...
0
7612
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...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
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...
0
7970
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...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
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...

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.