Additional information: No connection could be made because the target machine actively refused

Hello,

I am currently getting this error when attempting to instantiate and remote object.
Currently, everything is located locally.

Here is a code snippet to further explain.
The highlighted code is where the error occurs.
Can anyone help?

Thanks

===========================================

namespace ResumeClient

{

publicclass ResumeClient

{

publicstaticvoid Main(string[] args)

{

ChannelServices.RegisterChannel(new TcpClientChannel());

ResumeLoader loader = (ResumeLoader)Activator.GetObject(typeof(ResumeLoader), "tcp://localhost:9932/ResumeLoader");

if(loader==null)

{ Console.WriteLine("Unable to get remote referance"); }

else

{

Resume resume = loader.GetResumeByUserID(1);

Console.WriteLine("ResumeID:"+ resume.ResumeID);

Console.WriteLine("UserID:"+ resume.UserID);

Console.WriteLine("Title:"+ resume.Title);

Console.WriteLine("Body:"+ resume.Body);

}

Console.ReadLine();//Keep the window from closing before we can read the result.

}//END OF MAIN METHOD

}//END OF ResumeClient Object

}//END OF ResumeClientNamespace

[2209 byte] By [stronghold] at [2008-1-13]
# 1
Hi stronghold,

Can u add the details of the Remoting config file as well ?

Regards,
Vikram

Vikram at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
Hello Stronghold,

Did you get rid of the problem? I have the same problem right now. Would you like to help me if you did?

Regards,

Laurence

laurence at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
The client side code looks fine. Can you post the snippet of the server side as well. Also check using netstat command if Port 9932 is already in use by some other application.

Regards,
Vikram

Vikram at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4

Please let me know if the problem has been identified and fixed. I am getting the same error, and mine is a test application with the client and the server existing in the same machine.

Thanks,
Bhupathy

BhupathyKandasamy at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5
Did you find the solution to the problem? Please let me know
ManikBambha at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6
Could you send the stack trace?
douglasp at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 7
Hi,
I am getting the same error, and mine is a test application with the client and the server existing in the same machine.

if any one gets solution for this, please let me know.

Thanks.
Km. Arumugam

Arumugam at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 8

I got the same error and I fixed it, but, the circumstances might not be the same as yours. I host the remote object in a Windows service app. I noticed the it wasn't listening to the port I expected to. First I defined and registered the channel in the Main() sub section, then I switch to OnStart() section and it worked.

So, you make sure that the server is really listening. I assumed that you guys configured an published the remote object correctly and declaring and invoking in the same manner on the client side.

Regards

Astaroth at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 9

I was also facing this error but since my application uses multithreading. In my case a new thread began just before server started listening and there was an error in the method being called in Threadstart. So it never reached till TcpListener, hence the error.

Hope your server side code also is listening to the same port. And this port is not already being used by some other service.

sanchita at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 10
In my case, I was getting this error message because I configured my remote object in a configuration file, but forgot the call to RemotingConfiguration.Configure().
TitoJermaine at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified