我正在尝试使用 Microsoft 的 SyncOrchestrator,但无法正常工作。有人有这方面的经验并愿意帮助我吗?
using Microsoft.Synchronization;
using Microsoft.Synchronization.Files;
public static void SyncFileSystemReplicasOneWay(FileSyncProvider sourceProvider, FileSyncProvider destinationProvider, Label progress_label)
{
try
{
SyncOrchestrator agent = new SyncOrchestrator();
agent.LocalProvider = sourceProvider;
agent.RemoteProvider = destinationProvider;
agent.Direction = SyncDirectionOrder.Upload; // Sync source to destination
SyncOperationStatistics stats = agent.Synchronize();
}
catch { }
}
调用 agent.Synchronize() 它给出了一个
InvalidComExceptionError: a com object that has been separated from its underlying rcw cannot be used.
有谁知道是什么原因导致了这个 InvalidComExceptionError?以前有人遇到过这个问题吗?我找不到任何参考。