为什么 MarshalByRefObject.InitializeLifetimeService 返回一个对象而不是 ILease?
我正在阅读 .NET Remoting 的 msdn 文档,并注意到 MarshalByRefObject.InitializeLifetimeService 方法返回一个对象而不是 ILease。文档说该方法返回 ILease 类型的对象,并且我找到的所有代码示例都将返回值转换为 ILease。但方法签名表明它返回一个对象。有人知道为什么吗?
我只是好奇... :-)
I am reading through the msdn docs for .NET Remoting and noticed that the MarshalByRefObject.InitializeLifetimeService method returns an object instead of an ILease. The documentation says that the method returns an object of type ILease and all code examples I have found casts the returned value to an ILease. But the methods signature says that it returns an object. Does anybody know why?
I'm just curious... :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
奇怪的。 Reflector 显示该方法所做的全部事情是:
它确实返回一个 ILease。因此,这可能只是库中的一个疏忽(必须向前传播以解决兼容性问题),特别是如果文档还声称它是 ILease
Odd. Reflector shows that all the method does is:
which does return an ILease. So it's probably just an oversight in the library (that has to be propogated forward for compatibility issues), especially if the documentation also claims it's an ILease