Starting in .NET 8, the affected methods throw a NotSupportedException at run time across all project types except Windows Forms and WPF. The APIs continue to remain obsolete (as error) across all project types, including Windows Forms and WPF.
Functions like: CreateRestorePoint SaveAsBinary LoadFromBinary uses BinaryFormatter and in .net8-windows i get SerializationException from System.CoreLib
Inner Exception : Source :System.Private.CoreLib Message :Serializing delegates is not supported on this platform. Type :System.Runtime.Serialization.SerializationException Stack trace : at System.MulticastDelegate.GetObjectData(SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, BinaryFormatterWriter serWriter) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.SaveHelper(Stream stream, IFormatter formatter)
Breaking change: BinaryFormatter disabled across most project types - .NET | Microsoft Learn
learn.microsoft.com/.../system.runtime.serialization.serializationexception
We currently don't support .NET 9 until our next release which we are working on currently.
You could work around this in net8 with a project setting. I was hoping this might have been addressed in the last release of the toolset, but I've just tried to update to net9 and I'm getting runtime errors. Quite disappointing really, given this has been coming for so long. Without naming names, I've just been reading an article by one of Infragistics competitors detailing their handling of it, and how they've been taking it seriously since the initial announcement in net6
The UltraDockManager class contains the following code:
private void LoadFromBinaryHelper(Stream stream) { IFormatter binaryFormatter = GetBinaryFormatter(); LoadHelper(stream, binaryFormatter); }
IFormatter is now deprecated.
LoadHelper then uses the IFormatter object to deserialize the stream.
This causes an issue for me when calling LoadFromBinary and throws an exception.
Now it's happening on WinForms. Any resolution? This can hardly be a surprise, it's been warning for a long time.
Hello and thank you for contacting Infragistics. Please attach a sample project isolating the behavior. Are you using our Windows Forms UltraToolbarsManager in an ASP.NET project? If so and the issue doesn't happen in in WinForms this would be considered not a supported environment.