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. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more