Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 注册 .net 远程服务后RemotingConfiguration.RegisterWellKnownServiceType(),有什么方法可以撤消此操作以使应用程序不再提供此服务?
RemotingConfiguration.RegisterWellKnownServiceType()
我检查了这个链接,但令人惊讶的是,似乎没有 UnregisterWellKnownServiceType-Method。
如果您将众所周知的类型注册为 Singleton,您可以使用:
RemotingServices.Disconnect(foo);
但首先你必须创建对象然后编组它而不是使用 RegisterWellKnownServiceType:
Foo foo = new Foo(); RemotingServices.Marshal(foo, uri);
如果您将众所周知的类型注册为 SingleCall,则无法执行此操作。