SCP in a .Net night job has stopped working

Advertisement

Waltman
Joined:
Posts:
1

SCP in a .Net night job has stopped working

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.

Reply with quote

Advertisement

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

Re: SCP in a .Net night job has stopped working

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.

Reply with quote

Guest

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!

Reply with quote

Advertisement

You can post new topics in this forum