You may already know this but in .net 5.0 the BinaryFormatter not supported any more.
I tried to upgrade my web api to .net 5.0 and get the exception ‘BinaryFormatter serialization and deserialization are disabled within this application. See BinaryFormatter security guide | Microsoft Docs for more information.’ when trying to do an Operations.Send(…). It’s not a problem for now I’ll revert back to .net core 3.1 where it works, just thought I’d give you a heads up .
I found adding the following configuration to my web api project the following will allow the binaryformatter to work:
<PropertyGroup> <TargetFramework>net5.0</TargetFramework> <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization> </PropertyGroup>
also you may need to investigate if there are security risks using the BinaryFormatter in some of the places it is used on, doc.Title, userInfo.email and hasing a JObject for instance.