Error using remoting services channel

Last post 07-02-2009 3:49 PM by awclements. 1 replies.

Sort Posts:

  • Error using remoting services channel

    07-02-2009, 1:03 PM
    • Member
      point Member
    • awclements
    • Member since 11-04-2008, 6:37 PM
    • Tucson, AZ
    • Posts 6

    I'm attmempting to hook a client up to the server via remoting.  The client code is an ASP.NET app and I'm running through VS2008.  The client remoting code is the following:



            EmailEnableGroupsWrapper.EmailEnableGroups service;
            TcpChannel channel = new TcpChannel();
            //ChannelServices.UnregisterChannel(channel);
            try
            {
                ChannelServices.RegisterChannel(channel, false);
            } catch (RemotingException re) {
                Console.WriteLine(re.StackTrace);
                ChannelServices.UnregisterChannel(channel);
                ChannelServices.RegisterChannel(channel, false);
            }
            ActivatedClientTypeEntry acte = new ActivatedClientTypeEntry(typeof(EmailEnableGroupsWrapper.EmailEnableGroups), "tcp://servername:portnumber/RemoteEnableEmailGroups");
            RemotingConfiguration.RegisterActivatedClientType(acte);
            service = new EmailEnableGroupsWrapper.EmailEnableGroups();
            service.EmailEnableGroupWithGroupName(groupName);
    


    When I get to "ChannelServices.RegisterChannel(channel, false);" it throws a remoting exception of "The channel 'tcp' is already registered".  As you can see above, the exception is caught and then I try to call "ChannelServices.UnregisterChannel(channel);" where I then get an error of "The channel 'tcp is not registered with remoting services".

    This is enough to drive a man insane.  Tongue out  Anyone know where I am going wrong?  There is NO other remoting code being called anywhere in the app, nor is this code being called previously by anything.  There's nothing in the configuration about the 'tcp' channel.


    Thanks in advance,

    Andy


    Filed under: ,
  • Re: Error using remoting services channel

    07-02-2009, 3:49 PM
    Answer
    • Member
      point Member
    • awclements
    • Member since 11-04-2008, 6:37 PM
    • Tucson, AZ
    • Posts 6

    It appears that the IIS server that VS2008 is using is on continously and it is holding the channel, keeping it registered through each debug session I run.  If I stop the IIS after each debug session, the channel needs to be registered anew.  It least it stopped the RemoteException.  Doesn't explain why the UnregisterChannel method doesn't work, however.  If anyone knows feel free to explain.  I'm curious what I have set up wrong.


    --Andy

Page 1 of 1 (2 items)