2011年4月28日

[.Net]Object has been disconnected or does not exist at the server.

I am writing a service allows developers to plug their executable into this service, the service shall manage and monitor the status of each plug-in. The service isolate each plug-in by their Category property into a separate AppDomain, each plug-in notify the service of certain events via delegation.

I got '”Object has been disconnected or does not exist at the server” error after certain period of time. Obviously this error occurs because of the remoting proxy has no long connected to the server since they are actually reside in different AppDomain and was expired.

To avoid this, I override the InitializeLifetimeService() method of my base plug-in class as follow to extend the lifetime service.

        public override object InitializeLifetimeService() {
            return null;
        }


To extend the server lifetime lease on each client call, I override InitializeLifetimeService() of the server object, in my case, the PlugInManagerBase class as following.



        public override object InitializeLifetimeService() {
            ILease lease = (ILease)base.InitializeLifetimeService();
            if (lease != null) {
                if (lease.CurrentState == LeaseState.Initial) {
                    lease.InitialLeaseTime = TimeSpan.FromHours(6);
                    lease.RenewOnCallTime = TimeSpan.FromHours(6);
                }
            }
            return lease;
        }

[Reporting Service] Page navigation is out of range

It has been a while since I last update this blog. I have to say it was a crazy project, and fortunately things are getting better and better. And I really hope that I can focus on architecture more to make the whole system better…

We have a [Page navigation is out of range] error while navigating reports. This issue occurs when you modify reporting viewer properties, mostly the report related settings (e.g. report url…etc) while page is posting back, there are two ways to avoid such issue:

  1. Check if is posting back. and if yes, omit report-viewer property change.
    void Page_Load(){
      if(IsPostBack)
        return;
      //Other codes...
    }



  2. Set AsyncRendering to “True” to use a non post back rendering.

About Me