title | description | type | page_title | slug | tags | ticketid | res_type |
---|---|---|---|---|---|---|---|
BinaryFormatter Serialization and Deserialization Are Disabled |
Learn why .NET 5 projects may throw the error 'BinaryFormatter serialization and deserialization are disabled within this application' and how to fix it. |
troubleshooting |
Error related to disabled BinaryFormatter serialization in .NET 5 |
binaryformatter-exception-after-upgrade-to-net5 |
.NET 5.0 |
1494918 |
kb |
Product | Progress® Telerik® Reporting | Up to R3 2020 |
The following error might be thrown after upgrade to .NET 5 from .NET Core or Blazor Projects.
Error registering the viewer with the service.
An error has occurred.
BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.
In the Telerik Reporting R1 2021(15.0.21.120) release, the issue is resolved. If you are using a previous version, we strongly recommend upgrading. If that's not possible, you can use the suggested workaround below.
Add the following lines of code to the csproj
file:
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>