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

jkwraase

Resolved

Martin has pointed out that I needed to add TransferOptions to SynchronizeDirectories as shown below
SynchronizationResult synchronizationResult;
synchronizationResult =
    session.SynchronizeDirectories(
        SynchronizationMode.Local, sLocalFolder, "/", false, options: transferOptions);
jkwraase

WinSCP Assembly c# script in SSIS ResumeSupport.State

I an trying to perform a synchronization in a C# script in SSIS. I would like to turn off ResumeSupport.State. I am using the code below, but I still get an error message of:
Transfer was successful, but temporary transfer file could not be renamed...

Thank you for any help!
using (Session session = new Session())
{
    // Connect
    session.Open(sessionOptions);
 
    TransferOptions transferOptions = new TransferOptions();
    // Disable transfer with resume support/to temporary filename for all files
    transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
    MessageBox.Show(transferOptions.ResumeSupport.State.ToString());
 
    // Synchronize files
    SynchronizationResult synchronizationResult;
    synchronizationResult =
        session.SynchronizeDirectories(
            SynchronizationMode.Local, sLocalFolder, "/", false);
 
    // Throw on any error
    synchronizationResult.Check();
 
    session.Close();
}