0 votes
by (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

System.Private.CoreLib

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

Sincerely
Jon L.

1 Answer

0 votes
by (148k points)
selected by
 
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.

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