SyncAgent missing SyncDirection Property RRS feed

  • Question




    SyncAgent is missing the SyncDirection Property why?


    Also I am getting  the following error compile time error "Cannot implicitly convert type 'Microsoft.Synchronization.Files.FileSyncProvider' to 'Microsoft.Synchronization.SyncProvider' when executing the line SyncAgent agent = new SyncAgent();


    Code Snippet

    FileSyncProvider sourceProvider = null;

    FileSyncProvider destinationProvider = null;



    sourceProvider = new FileSyncProvider(sourceReplicaId.GetGuidId(), sourceReplicaRootPath, filter, options);

    destinationProvider = new FileSyncProvider(destinationReplicaId.GetGuidId(), destinationReplicaRootPath, filter, options);

    destinationProvider.AppliedChange += new EventHandler<AppliedChangeEventArgs>(OnAppliedChange);

    destinationProvider.SkippedChange += new EventHandler<SkippedChangeEventArgs>(OnSkippedChange);

    SyncAgent agent = new SyncAgent();

    agent.LocalProvider = sourceProvider;

    agent.RemoteProvider = destinationProvider;

    //agent. = SyncDirection.; // Sync source to destination

    Console.WriteLine("Synchronizing changes to replica: " + destinationProvider.RootDirectoryPath);





    Any ideas?


    • Moved by Max Wang_1983 Thursday, April 21, 2011 9:43 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Friday, September 19, 2008 2:39 PM


  • I think the trouble you're running into is because SyncAgent is intended to be used for DB sync.  For file sync or other general sync, you want to use the SyncOrchestrator (http://msdn.microsoft.com/en-us/library/microsoft.synchronization.syncorchestrator.aspx). I think we may have had a name change between one of our CTPs and the 1.0 version, which is probably where the confusion comes from.  The SyncOrchestrator should allow you to specify the direction.



    Friday, September 19, 2008 10:59 PM