SFTP with Renci.SshNet in NAV and constructor - NAV 2018 Cu8

vremeni4vremeni4 Member Posts: 323
Hi,

I need to implement SFTP in NAV so I decided to use Renci.SshNet .Net dll.
So far so good I can access the Renci.SshNet in NAV, but I cannot call any of the constructors. :-(
For example I need to create a variable ConnectionInfo.'Renci.SshNet with a hostname username and pass.
If I call the function like this
ConnInfo := ConnInfo(HostName ,'demo',passauthen);
or this
ConnInfo(HostName ,'demo',passauthen);
I am getting following error message.
ConnInfo is not a function, and only functions can be called with '(....'.

I can do this though
ConnInfo := ConnInfo;
but then I have no way of assigning the parameters e.g. hostname username and pass.
There are functions/properties for example ConnInfo.Host;
but they only return the parameter and they do not allow me to set it
[string Host :=] ConnInfo.Host()

What I do not understand if I go to "CAL Symbol Menu" and select the variable ConnInfo with option "Past Arguments"
I get this
[ConnectionInfo ConnectionInfo :=] ConnInfo.ConnectionInfo(string host, string username, AuthenticationMethod[] authenticationMethods)
But if I try to do this in the CAL editor I get the above error message.
Also the tool tip shows that the variable ConnInfo
has no parameters?!?!?
See screen shot
xyitfw9mqq8d.jpg

I tried to set the variable "RunOnClient" but this made no difference.
Is this a restriction in NAV or am I missing something.

Thanks for your help.

Answers

Sign In or Register to comment.