Tuesday, August 15, 2006

RegisterChannel is obsolete, use RegisterChannel instead

I got this error:

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

It threw me off for a little while because System.Runtime.Remoting.ChannelServices.RegisterChannel doesnt' really exist

the problem there was that they just missed the .Channels part of the namespace, so it should've been:

"use 'System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead"

ok, that was the first part, now if this overload is obsolete, which one is the equivalent?

RegisterChannel(chnl, true)


RegisterChannel(chnl, false)

Reflector to the rescue, the equivalent is to use false as the second parameter, that's what the current function does right now when you call


it calls:

ChannelServices.RegisterChannelInternal(chnl, false);

No comments: