“对象已断开连接或在服务器上不存在"例外 [英] "Object has been disconnected or does not exist at the server" exception

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

问题描述

我需要在我的应用中使用跨应用域调用,有时我会遇到这个 RemotingException:

I need to use cross-appdomain calls in my app, and sometimes I have this RemotingException:

对象 '/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmkhdinj7g2kpkhc_7.rem' 已断开连接或在服务器上不存在.

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 处理.

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.

推荐答案

那可能是因为服务端的本地垃圾收集器收集了对象.您可以通过续订租约来防止这种情况发生.您可以在以下文章中阅读更多相关信息:

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:

更新:不幸的是,2008 年或更早版本的 MSDN 杂志无法在线浏览,只能作为 .chm 文件下载到本地计算机.以前的问题可以在:

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:

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆