SyncOrchestrator InvalidComObjectException

时间:2012-10-30 14:57:39

标签: .net sync microsoft-sync-framework synchronize

我正在尝试使用Microsofts 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的原因是什么?以前有人有这个问题吗?我找不到任何参考资料。

0 个答案:

没有答案