Mono Support WAO IndexOutOfRangeException: Index was outside the bounds of the array Error 

Viewed 19592 time(s), 2 post(s), 1/4/2016 3:52:26 PM - by stevescotthome
1/4/2016 3:52:26 PM
50 Reputation 7 Total posts

Site got hammered over the weekend, users were getting this error

System.Collections.Generic.List`1+Enumerator.MoveNext():35
   ..(String requestDomain):158
MonoSoftware.Web.WAO.ViewState.Configuration.ViewStateConfiguration.GetPageStatePersister(Page page):47
Medportal.Sitefinity.Controls.Code.CustomViewStatePage.get_PageStatePersister() in C:\Medportal\Master\Medportal.Sitefinity.Controls\Code\CustomViewStatePage.cs:24
System.Web.UI.Page.RegisterRequiresControlState(Control control):105
Telerik.Web.UI.RadListView.OnInit(EventArgs e):21
System.Web.UI.Control.InitRecursive(Control namingContainer):255
System.Web.UI.Control.InitRecursive(Control namingContainer):143
System.Web.UI.Control.InitRecursive(Control namingContainer):143
System.Web.UI.Control.AddedControl(Control control, Int32 index):194
System.Web.UI.Control.EnsureChildControls():70
System.Web.UI.Control.PreRenderRecursiveInternal():47
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Control.PreRenderRecursiveInternal():142
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint):1747

This is the class
public class CustomViewStatePage : System.Web.UI.Page
    {
        private System.Web.UI.PageStatePersister _pageStatePersister = null;
 
        protected override System.Web.UI.PageStatePersister PageStatePersister
        {
            get
            {
                if (_pageStatePersister == null)
                    _pageStatePersister = ViewStateConfiguration.GetPageStatePersister(this.Page);
                return _pageStatePersister;
            }
 
        }
 
        protected override object LoadPageStateFromPersistenceMedium()
        {
            try
            {
                return base.LoadPageStateFromPersistenceMedium();
            }
            catch (Exception ex)
            {
                //Handle the missing viewstate by returning the empty state pair
                System.Web.UI.PageStatePersister pageStatePersister = new System.Web.UI.HiddenFieldPageStatePersister(this.Page);
                Debug.WriteLine(ex);
                return new System.Web.UI.Pair(pageStatePersister.ControlState, pageStatePersister.ViewState);
            }
        }
    }

We are using the DB persisted config... any idea what the problem might have been?  Was the DB down or something maybe? ...can the error be elegantly handled somehow?

1
1/4/2016 3:58:34 PM
15993 Reputation 2214 Total posts

Hi,

can you please send us web.config WAO configuration so we can review ?

Regards

2
This is a demo site for MonoX. Please visit Mono Software for more info.