0

使用 注册 .net 远程服务后RemotingConfiguration.RegisterWellKnownServiceType(),有什么方法可以撤消此操作以使应用程序不再提供此服务?

我检查了这个链接,但令人惊讶的是,似乎没有 UnregisterWellKnownServiceType-Method。

4

1 回答 1

1

如果您将众所周知的类型注册为 Singleton,您可以使用:

RemotingServices.Disconnect(foo);

但首先你必须创建对象然后编组它而不是使用 RegisterWellKnownServiceType:

Foo foo = new Foo();
RemotingServices.Marshal(foo, uri);

如果您将众所周知的类型注册为 SingleCall,则无法执行此操作。

于 2013-04-10T21:09:15.763 回答