本文介绍了"对象已断开或服务器&QUOT不存在;例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在我的应用程序使用跨AppDomain的电话,有时我有这个RemotingException:对象/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmkhdinj7g2kpkhc_7.rem已断开或在服务器不存在。
目标对象还活着,我已经检查了。

I need to use cross-appdomain calls in my app, and sometimes I have this RemotingException:Object '/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmkhdinj7g2kpkhc_7.rem' has been disconnected or does not exist at the server.
The target object is still alive, I have checked it.

UPD我给自己定了目标对象的终结断点,它从来没有击中。因此,这个对象是活的,并没有GC'ed。

UPD I've set breakpoint in the finalizer of the target object, and it never hits. Thus, this object is alive and wasn't GC'ed.

推荐答案

这可能是因为当地的垃圾收集器在服务器端收集的对象。您可以prevent通过续订租赁。你可以阅读更多有关这些文章:

That is probably because the local garbage collector at the server side collects the object. You can prevent that by renewing the leasing. You can read more about that in these articles:

  • Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship
  • CLR Inside Out: Managing Object Lifetime

更新:不幸的是,从2008年或更旧的MSDN杂志的问题不再是浏览的网络,但只有你有作为.chm文件下载到本地计算机。在previous问题中可以找到:

Update: Unfortunately, the MSDN Magazine issues from 2008 or older are no longer browseable online, but only as .chm files that you have to download to your local machine. The previous issues can be found in:

  • 管理与租赁和赞助远程.NET对象的生命周期中的 2003年12月发行
  • 在CLR内向外:在 2007年11月发行
  • Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship in December 2003 issue
  • CLR Inside Out: Managing Object Lifetime in November 2007 issue

这篇关于"对象已断开或服务器&QUOT不存在;例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 22:03