Not able to create instance of Session class in c#.

Advertisement

dgpuranik
Joined:
Posts:
3
Location:
United States

Not able to create instance of Session class in c#.

Hi,

I am using WinSCP to download and upload files in C# program. My code look like this

public Session OpenSftpSession ()
    {
      SessionOptions sessionOptions = new SessionOptions ();
      sessionOptions.Protocol = WinSCP.Protocol.Sftp;
      sessionOptions.HostName = this.hostName_;
      sessionOptions.UserName = this.userName_;
      sessionOptions.Password = this.password_;
      sessionOptions.SshHostKeyFingerprint = this.sshHostKeyFingerprint_;

      Session session = null;
      try
      {
        session = new Session ();
        session.Open (sessionOptions);
      }
      catch (Exception ex)
      {
        return null;
      }

      return session;
    }

When program execute line
session = new Session ();
it terminates. I don't even get any exception it just exception.

Thanks,
Darshan.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,506
Location:
Prague, Czechia

Re: Not able to create instance of Session class in c#.

Inspect all debugger windows to see if you find something interesting.

Reply with quote

Advertisement

You can post new topics in this forum