? .Net2: ChannelServices.RegisterChannel is obsolete - So what SHOULD I use ?

I have this line of code in a .Net 2 program:

            System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel( new TcpChannel( INCOMING_PORT ) );

This gives a warning:

'System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)' is obsolete: 'Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.'

The thing is, as far as I can see, System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) doesn't exist!

What should I do



Answer this question

? .Net2: ChannelServices.RegisterChannel is obsolete - So what SHOULD I use ?

  • seoindia

    Just use the normal argument, but put a bool argument after it.
  • luben111

    I'll answer my own question:

    The "obsolete" message is incorrect. It's missing the ".Channels" bit!

  • Magannahan Skjellifetti

    Oh...now I see. The annoying message disappeared...

    thks



  • Keehan

    Its works!! Thought i was the only one stuck with this annoying error

    Thks r3n


  • Kayuse

    Hi!

    I'm facing the same problem here. I did not get your answer...where did you place the missing "".Channels"



  • Debralour

    Yeah, they messed up... they really just want you to add the boolean argument since apparently there's a new security feature.

  • ? .Net2: ChannelServices.RegisterChannel is obsolete - So what SHOULD I use ?