How to resolve the BinaryFormatter exception when using .NET 6.0

1 Answer 144 Views
Rendering Serialization
Devon
Top achievements
Rank 1
Devon asked on 27 Feb 2024, 06:55 AM

When we try to process a report from a .NET 6 application, there is an exception
 "BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information."
Version used: Telerik R1 2023 SP1

On Telerik forums, there is a workaround to suppress this error, see below:
https://www.telerik.com/forums/aspnetcore-5-support
https://docs.telerik.com/reporting/knowledge-base/binaryformatter-exception-after-upgrade-to-net5
However, based on this post the BinaryFormatter is necessary for serialization and not having it will cause issues with image generation.
Please advise if there is a way to generate reports with images from a .NET 6 app without using EnableUnsafeBinaryFormatterSerialization.

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 01 Mar 2024, 06:00 AM

Hi Devon,

Can you please confirm whether your are having a .NET 6 application that only loads the .NET Standard assemblies of Telerik Reporting? Binary Formatter was a very common and very powerful tool in the .NET Framework stack, which fell out of grace due to inherent vulnerability to unsafe deserialization. We are aiming to remove it from the codebase and there are few occurrences with low/no exploitability that are left in the .NET Framework version of the assemblies. However, all of the usages in .NET Standard, had been removed and adapted to JSON serialization in the version that you are referring to.

Regards,
Ivan Ivanov
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
Rendering Serialization
Asked by
Devon
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or