SharePoint 2016-Error while executing web part: System.IndexOutOfRangeException: Index was outside the bounds of the array

October 30, 2017

Issue:
A list view web part, was inserted in a web part zone, such that custom XSLT was attached to it to do the data formatting. List view web part stopped working with following error in logs.

Error while executing web part: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.Xslt.MethodCollection.ResolveMethodDef(Int32 tokenNum)
at Microsoft.Xslt.MethodCollection.MethodDescription.SetCode(DynamicILInfo ilInfo, Int32[] fixup, Byte[] ilCode, Byte[] ehTable, Int32 maxStackSize, MethodCollection methodColl)
at Microsoft.Xslt.MethodCollection.MethodDescription.DefineDynamicMethod(DynamicMethod dm, MethodCollection methodColl)
at Microsoft.Xslt.MethodCollection.CreateDynamicMethods()
at Microsoft.Xslt.MethodCollection.GetMethodInfoInternal(Int32 methodNumber)
at Microsoft.Xslt.MethodCollection.GetMethodInfo(Int32 methodNumber)
at Microsoft.Xslt.STransform.GetCompiledTransform()
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

Solution:
In central admin, see the list of server, to check, if some server is need an update. Update all servers.
As shown, below.

Restart the whole SharePoint farm.

Still, that above exception remains there.
Next step is to , remove the list view web part, and add again. This will solve the exception and List view web part will start working.

Advertisements