WinSCP Assembly c# script in SSIS ResumeSupport.State

Advertisement

jkwraase
Joined:
Posts:
2

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();
}
  • 2023-03-20_11-59-45.jpg (30.44 KB, Private file)

Reply with quote

Advertisement

jkwraase
Joined:
Posts:
2

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);

Reply with quote

Advertisement

You can post new topics in this forum