Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UNregister a WellKnownClientType?

107 views
Skip to first unread message

Christian Bensberg

unread,
Dec 22, 2001, 2:03:51 PM12/22/01
to
Hi!

I use RemotingConfiguration.RegisterWellKnownClientType(...) to access an
object (singleton mode) on a remote AppDomain for a single call. Then I want
to to UNregister this type again and use it as a standard local type.
How can I do this? Using RemoteService.Disconnect(...) does not seam to
work.

Thanks.
Chris


Willy Denoyette

unread,
Dec 22, 2001, 3:20:13 PM12/22/01
to
Use UnregisterChannel to unregister the Channel after Disconnect.

// Disconnect object and Unregister channel
RemotingServices.Disconnect(......);


ChannelServices.UnregisterChannel(yourChannel);

// Go back and rereg again

Willy.

"Christian Bensberg" <bens...@web.de> wrote in message news:OB0g5txiBHA.772@tkmsftngp04...

Christian Bensberg

unread,
Dec 23, 2001, 1:28:16 PM12/23/01
to
The following code raises an error:

client_channel = Remoting.Client.Channel();

Remoting.Client.ClientType(typeof(List), "localhost", ServicePort,
"AM7service", ListUri);


l = new List();

if(RemotingServices.IsTransparentProxy(l) != true)

throw new Exception("object is not a proxy");

// call

AppItem = new ApplicationItem(port, applicationName);

l.AddApplication(AppItem);

// disconnect


RemotingServices.Disconnect(List); // error: "Can not disconnect a proxy"
(translatet)

ChannelServices.UnregisterChannel(client_channel);

Any solutions?

Thanks

Christian Bensberg

Willy Denoyette

unread,
Dec 23, 2001, 5:19:10 PM12/23/01
to
RemotingServices.Disconnect(l);


"Christian Bensberg" <bens...@web.de> wrote in message news:OLuGv#9iBHA.2432@tkmsftngp02...

Christian Bensberg

unread,
Dec 23, 2001, 6:08:34 PM12/23/01
to

> RemotingServices.Disconnect(l);


Well, you are right. I tried "l" and got the previously mentioned runtime
error. Then I replaced "l" with "List" and directly got the expected error
when building the app. I copied the wrong code into my last message.
--> It does not work with RemotingServices.Disconnect(l), as "a proxy cannot
be disconnected" (adapted from the error message). :-(

Chris


0 new messages