0 votes
by (350 points)

I have a customer that when we try to use Rebex to make a SSH connection it fails.
So to try simplify things we used the SftpWinFormClient.exe app and then pressed the Connect button and got the Connection Dialog to show up.
On that dialog down at the Private key: line we pressed the Import button and then selected the .pri file to import the key but it return a dialog with the following error:
Error occurred when importing key.
Detailed description:
Method not found: '!!0[] System.Array.Empty().

We tried it multiple times and verified the .pri file was not empty.
We used the app that came in the 6.7 trial that was already compiled. The app worked fine on our computers but not on the customer's PC.
So could they be missing some windows file that is used during a key import?
Any suggestions would be much appreciated.

Thanks
Tom

1 Answer

+1 vote
by (147k points)

The pre-compiled SftpWinFormClient.exe is compiled for .NET Framework 4.6. Is this (or later 4.x version) available on customer's PC? It looks like this particular error occurs when there's a version mismatch. See Method not found: '!!0[] System.Array.Empty()' on StackOverflow for details.

Alternatively, recompile the sample application yourself for .NET Framework 4.0. This will produce an executable that runs on all versions of .NET Framework 4.x.

by (350 points)
We found out that the customer was only running .net 4.0 (Win7) and when he upgraded to 4.8 the issues went away.   The strange thing is our app (not the rebex test app.)   was compiled as a .net 4.0 client app and issues using the Rebex dlls.
Since I do not have the Rebex source but just the Rebex dlls... if the dlls have been compiled as 4.6 dlls then does it really matter if my app is compiled as 4.0?   
Any way problem solved.     -- Thanks
by (147k points)
DLLs compiled for .NET 4.6 use several APIs that have not been available in .NET 4.0 (such as await/async infrastructure). If they end up being used by an app compiled for .NET 4.0, they would work fine when running on .NET 4.6 or higher. However, when running on .NET 4.0-4.5.2, they would fail due to missing APIs.
...