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

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

{

public class ResumeClient

{

public static void 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



Answer this question

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

  • leecsone

    Did you find the solution to the problem Please let me know

  • Darren M. Bork

    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


  • Markchr

    Hi stronghold,

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

    Regards,
    Vikram

  • Asura

    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.



  • blarggstar

    Could you send the stack trace
  • tentod

    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

  • hypermatt

    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().
  • TechGuyMark

    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



  • Ben Mills

    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



  • Urue

    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

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