Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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

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

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.