“Object has been disconnected or does not exist at the server” exception

后端 未结 7 851
孤街浪徒
孤街浪徒 2020-12-04 19:31

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

Object \'/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmk

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 19:59

    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

    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:

    • 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

提交回复
热议问题