Exception "Secure binary serialization is not supported on this platform"

0 votes
asked Nov 5 by JL (150 points)

Hello, I am using Rebex.Net.Scp to connect to a device. This code works fine in .NET Framework 4.7.2, but fails in .NET 5.0

I get this exception:
"Secure binary serialization is not supported on this platform."
at System.Exception.add_SerializeObjectState(EventHandler`1 value)
at Rebex.SafeSerializer.PseudoExceptionStorage..ctor(SafeSerializer epk)
at Rebex.SafeSerializer..ctor(ISafeSerializable eoz)
at Rebex.Net.Proxy..ctor(ProxyType proxyType, ProxyAuthentication authenticationMethod, String host, Int32 port, Boolean bypassOnLocal, NetworkCredential credentials)
at iarb.cray(ISocketFactory ug, ILogWriter uh)
at Rebex.Net.Scp.wtyq(String br, Int32 bs, SshParameters bt, lgqx bu)
at Rebex.Net.Scp.wtyp(String bo, Int32 bp, SshParameters bq)
at Rebex.Net.Scp.Connect(String serverName, Int32 serverPort)
at ...NetworkConnection.Connect() in C:...\NetworkConnection.cs:line 381
at systemadministrator.Utils.NetworkConnection.CheckOnLineState(String caller, Boolean fromOnlineMonitor) in C:...\NetworkConnection.cs:line 582


What can I do to make it work in .net 5.0 ?

Jon L.

1 Answer

0 votes
answered Nov 5 by Lukas Pokorny (126,870 points)
selected Nov 5 by JL
Best answer

This looks like you are using an old version of Rebex libaries that did not support .NET 5.0 yet.

To resolve the issue, please upgrade to 2020 R5.0 or later.

commented Nov 5 by JL (150 points)
Yep! I was running 4.x. I upgraded to latest version. Now I don't get any exception anymore, thanx!