A community member has associated this post with a similar question:
Post SP2019 Sep CU webpart problem

Only moderators can edit this content.

Issue when Webpart with a custom toolbar is loaded after SharePoint 2019 September 2024 CU installation

David Esperanza 0 Reputation points
2024-09-19T15:55:02.1166667+00:00

Hi,

After installing the SharePoint 2019 September 10th Cumulative Update (this one), our custom webpart toolbar property appears to be causing an issue when attempting to render the webpart control. The exception we encounter is the following:

[ArgumentException: The serialized data is invalid.]
  at Microsoft.SharePoint.WebPartPages.SPObjectStateFormatter.Deserialize(Stream inputStream)
  at Microsoft.SharePoint.WebPartPages.Utility.DeserializeByteArrayToObject(SPSerializationBinderBase binder, Byte[] bytes)
  at Microsoft.SharePoint.WebPartPages.BinaryWebPartDeserializer.LoadInitialWebPart()
  at Microsoft.SharePoint.WebPartPages.BinaryWebPartDeserializer.Deserialize()
  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)

[UnsafeControlException: The control type 'System.Collections.Generic.List`1[[IC.He.SharePointWeb.SP.WebParts.WebpartColumn, IC.He.SharePointWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=50a0670ec03a0037]]' is not allowed on this page. ]
  at Microsoft.SharePoint.WebPartPages.SPSerializationBinder.IsAllowedType(Type type)
  at Microsoft.SharePoint.WebPartPages.SPSerializationBinderBase.CheckIfAllowedType(Type type)
  at Microsoft.SharePoint.WebPartPages.SPSerializationBinderBase.BindToType(String assemblyName, String typeName)
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Bind(String assemblyString, String typeString)
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
  at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
  at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
  at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
  at Microsoft.SharePoint.WebPartPages.SPObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
  at Microsoft.SharePoint.WebPartPages.SPObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
  at Microsoft.SharePoint.WebPartPages.SPObjectStateFormatter.Deserialize(Stream inputStream)


In our web.config we have defined our assembly as a safe control in the following manner:

      <SafeControl Assembly="IC.He.SharePointWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=50a0670ec03a0037" Namespace="IC.He.SharePointWeb.SP.WebParts" TypeName="*" Safe="True" />
      <SafeControl Assembly="IC.He.SharePointWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=50a0670ec03a0037" Namespace="IC.He.SharePointWeb.WebParts" TypeName="*" Safe="True" />

I have tried tinkering with the AllowListItems, since it seems to be related to the serialization of collections, but I couldn't find a value that corresponds to the Sytem.Collections.Generic.List type.

I attach the full correlation log too: webpart-log.txt

Any help would be appreciated

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2024-09-20T02:03:13.51+00:00

    Hi @David Esperanza ,

    The error message indicates that the serialized data is invalid, and the control type System.Collections.Generic.List1[[IC.He.SharePointWeb.SP.WebParts.WebpartColumn, IC.He.SharePointWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=50a0670ec03a0037]]` is not allowed on the page.

    Try to install the SharePoint Server 2019 Language Pack Update (KB5002597) to see if the issue is resolved.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments