0 votes
by (160 points)

I have installed Rebex.SFTP nuget to Xamarin.Android,Xamarin.ios,xamarin.UWP platforms .Able to connect to SFTP and dowmload and upload in all 3 platforms.
But,In release mode it is working in android and ios but not UWP.
Getting above exception and also getting
"System.PlatformNotSupportedException"Skipped loading symbols. Module is native, and native debugging is currently disabled.
imp#31232(...) returned null.

Anyone please help me

Applies to: Rebex SFTP

1 Answer

0 votes
by (146k points)
Could you please describe the steps that trigger the error? Are you actually trying to launch an UWP app, compiled in release mode, in a debugger? Or did this occur when you attempted some other action?
by (160 points)
App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\wshbth.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\dnsapi.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\winrnr.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
Exception thrown: 'System.PlatformNotSupportedException' in System.Private.CoreLib.dll
Exception thrown: 'System.PlatformNotSupportedException' in System.Private.CoreLib.dll
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
'App1.UWP.exe' (Win32): Loaded 'C:\Windows\System32\dssenh.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
**__imp__#31142**(...) returned null.

Exception thrown: 'Rebex.Net.SshException' in Rebex.Networking.dll
Exception thrown: 'Rebex.Net.SshException' in Rebex.Sftp.dll
Exception thrown: 'Rebex.Net.SftpException' in Rebex.Sftp.dll
The thread 0x8880 has exited with code 0 (0x0).
Negotiation failed.
by (160 points)
I have changed licence key and updated Rebex.SFTP to  v7.0.8865  still facing issue

 try
                {
                    using (var client = new Rebex.Net.Sftp())
                    {
                        AsymmetricKeyAlgorithm.Register(EllipticCurveAlgorithm.Create);
                        // register Curve25519
                        AsymmetricKeyAlgorithm.Register(Curve25519.Create);
                        // register Ed25519
                        AsymmetricKeyAlgorithm.Register(Rebex.Security.Cryptography.Ed25519.Create);
                        client.Connect(host, port);
                        client.Login(user, pass);
                    Trace.WriteLine("Connected successfully");
                        if (!client.DirectoryExists(path))
                            ok = false;

                        client.Disconnect();
                    }
                }
by (146k points)
The error indicates that Rebex SFTP was actually able to connect to the server, but failed while negotiating an SSH session. However, we would need more information about the error to be able to tell what is going on. This exception you got is supposed to contain an InnerException with additional information. Try putting the client.Connect call inside a try/catch block and show the full error, like this:

                try
                {
                    using (var client = new Rebex.Net.Sftp())
                    {
                        ...
                        client.Connect(host, port);
                        client.Login(user, pass);
                        Trace.WriteLine("Connected successfully");
                        ...
                    }
                }
                catch (Rebex.Net.NetworkSessionException ex)
                {
                    Trace.WriteLine("SFTP error: " + ex.ToString())
                }
by (160 points)
Hi Lukas,
The issue is with KeyAlgorithms.
After removing KeyAlgorithms it worked.

AsymmetricKeyAlgorithm.Register(EllipticCurveAlgorithm.Create);
                        // register Curve25519
                        AsymmetricKeyAlgorithm.Register(Curve25519.Create);
                        // register Ed25519
                        AsymmetricKeyAlgorithm.Register(Rebex.Security.Cryptography.Ed25519.Create

I removed the above lines in UWP project then it worked
by (146k points)
Hi, thanks for letting us know!
It looks like the plugins might not be compatible with UWP's .NET Native compiler (used in release mode). Fortunately, these plugins are not actually needed on UWP, so keeping them for iOS and Android hopefully resolves the issue.
...