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

    Question

  • 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

    Friday, April 29, 2005 8:21 PM

Answers

  • Could you send the stack trace?
    Wednesday, July 13, 2005 11:07 PM
    Moderator

All replies

  • Hi stronghold,

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

    Regards,
    Vikram
    Saturday, April 30, 2005 4:13 AM
    Moderator
  • 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
    Thursday, May 19, 2005 6:54 PM
  • 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
    Friday, May 20, 2005 10:27 PM
    Moderator
  • 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

    Wednesday, June 29, 2005 3:58 PM
  • Did you find the solution to the problem? Please let me know
    Monday, July 11, 2005 6:23 PM
  • Could you send the stack trace?
    Wednesday, July 13, 2005 11:07 PM
    Moderator
  • 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
    Friday, November 04, 2005 12:16 PM
  • 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

    Monday, January 09, 2006 8:32 PM
  • 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.

    Thursday, June 22, 2006 5:38 AM
  • 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().
    Wednesday, November 22, 2006 2:22 PM