FileSyncProvider as a source and my own provider as a destination RRS feed

  • Question

  • I'm trying to use the FileSyncProvider as a source, and my own provider as a destination. Is this a supported scenario? Or is the assumption that both providers have to be the of the same kind?


    The specific issue I'm running into is that I can not seem to get a IChangeDataRetriever from the FileSyncProvider, is this by design?




    • Moved by Max Wang_1983 Wednesday, April 20, 2011 9:46 PM Forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Friday, August 8, 2008 9:20 PM


  • I believe it will be considered in v2 or earlier CTPs.

    Friday, August 8, 2008 10:18 PM

All replies

  • That's a supported scenario, however there is a limitation currently.

    If you are using C++ code, you could implment IFileDataRetriever then you will be able to write your own provider to sync with FileSyncProvider.

    But That's not supported in managed framework yet.


    Friday, August 8, 2008 9:45 PM
  • Thanks! When do you think this will be supported in manage code?
    Friday, August 8, 2008 9:59 PM
  • I believe it will be considered in v2 or earlier CTPs.

    Friday, August 8, 2008 10:18 PM
  • Bassam, have you ever got any solution to this?

    Jin, Is this taken care in MSF V2 CTP2? can you point me to some article?
    Monday, September 7, 2009 10:36 AM
  • Synchronizing the file synchronization provider with a custom provider using managed code is supported in Sync Framework 2.0. This article in the product documentation explains how to do this: http://msdn.microsoft.com/en-us/library/ee617372(SQL.105).aspx.

    This sample on Code Gallery may also help: http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3592.
    Wednesday, December 9, 2009 12:30 AM
  • Has this been included in V2?  If I implement IChangeDataRetriever in an overriden FileSyncProvider class, nothing happens.  Am I implementing the interface in the wrong place?
    Friday, December 11, 2009 5:52 AM
  • This is included in Sync Framework 2.0. You shouldn't need to override the FileSyncProvider class to implement this. Here's what you need to do:

    • Implement IFileDataRetriever in your custom provider. This implementation returns your item data in a format that the file synchronization provider can use.
    • When your custom provider is the source provider, its LoadChangeData method is called to retrieve item data. Return your IFileDataRetriever object. The destination provider (FileSyncProvider in this case) retrieves data by calling the methods on your IFileDataRetriever object.
    • When your custom provider is the destination provider, its SaveItemChange method is called to apply a change. The SaveChangeContext.ChangeData object that is passed to this method is an IFileDataRetriever implementation. Cast the object to the IFildDataRetriever interface and retrieve the file data to apply.

    This is all explained in greater detail in the document referenced above.

    Friday, December 11, 2009 6:53 PM