Issue when Webpart with a custom toolbar is loaded after SharePoint 2019 September 2024 CU installation
Hi,
We have encountered an issue after installing the SharePoint 2019 September 2024 Cumulative Upgrade (this one), where a webpart control is unable to load due to the following exception:
[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)
The assembly of the type that is throwing the error is included in our application's web.config safe controls as follows:
<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 specifying the TypeName directly, but nothing seems to work. This class is a simple class holding a couple of properties describing some rendering configuration for the webpart's content and is configurable using the publishing page check-out/check-in flow.
Is the problem the type combination of System.Collections.Generic.List and IC.He.SharePointWeb.SP.WebParts.WebpartColumn? how can this be addressed or defined in our web.config?