Topic "SCP in a .Net night job has stopped working"

Author Message
[View user's profile]

Joined: 2017-01-24
Posts: 1
I have a file transfer I make each night. It's been running well for a little while now. But I've moved the job to a new server, now it's erroring out. The message is "SessionOptions.FtpSecure is not FtpSecure.None, but SessionOptions.Protocol is not Protocol.Ftp." Here are my Session.Options

               sessionOptions = new SessionOptions
                  Protocol = Protocol.Sftp,
                  HostName = ConfigurationManager.AppSettings["BBTAddress"],
                  UserName = ConfigurationManager.AppSettings["Username"],
                  Password = ConfigurationManager.AppSettings["Password"],
                  PortNumber = Convert.ToInt32(ConfigurationManager.AppSettings["Port"]),

                  SshHostKeyFingerprint = ConfigurationManager.AppSettings["sFTPServerKey"],
                  GiveUpSecurityAndAcceptAnyTlsHostCertificate = true,
                  FtpSecure = FtpSecure.Implicit,

I've been on this all day long and can't make heads nor tails of it. Is there anything I can do? I've updated to 5.9.3 hoping it would fix it. It did not.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
The error message says it, the FtpSecure is not used with SFTP protocol. Just remove the line FtpSecure = FtpSecure.Implicit.

The code could have never worked.

I thought the same thing, but that's what was in the "live' branch in TFS. Either way, I simplified the options and it's working fine now. Thanks!

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License