Forum Discussion
Hi Phil,
Try adding the WinSCPnet.dll assembly to the CLR Bridge and calling it via dotNET. Eliminating the COM interop layer should help avoid data conversion issues, or at least give you more meaningful errors:
function testWinSCP() { var session = dotNET.WinSCP.Session.zctor(); var sessionOptions = dotNET.WinSCP.SessionOptions.zctor(); sessionOptions.Protocol = dotNET.WinSCP.Protocol.Sftp; // Not sure if correct sessionOptions.HostName = "10.23.0.41"; sessionOptions.UserName = "oracle"; sessionOptions.Password = "Orac1e"; sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 25:e2:6e:db:39:9e:50:e0:6f:57:7f:54:07:0a:a2:a1"; try { session.Open(sessionOptions); } catch( e ) { Log.Message(e.message); } finally { session.Dispose(); } }
Hi Helen, I am actually trying to find a way to avoid using the CLR Bridge which is why I was investigating the COM library.
I have found that Test Complete appears to have problems resolving the dependencies for the WinSCPnet.dll assembly.
This manifests itself by the WinSCP Namespace not being available under the dotNet Object
with the only way to get it to work is to register the assembly iin the Global Assembly Cache which has caused issues when executing tests on different machines.
I have started writing a static .Net Interface that abstracts the WinSCPnet.dll assembly which so far appears to be working ok.
Phil
Related Content
- 6 years ago
- 4 years ago
- 4 years ago
Recent Discussions
- 13 hours ago