locked
FileSyncProvider Exception RRS feed

  • Question

  • I'm getting the following exception when calling the FileSyncProvider constructor like this:

            FileSyncProvider provider = null;

            try
            {
                provider = new FileSyncProvider(replicaId, replicaRootPath, filter, options);
                provider.DetectChanges();
            }
            finally
            {
                // Release resources
                if (provider != null)
                    provider.Dispose();
            }


    This is the exception:

    -        [System.IO.FileNotFoundException]    {"The FileSyncProvider must be initialized to perform this operation.":null}    System.IO.FileNotFoundException

    This is the stacktrace:

       at Microsoft.Synchronization.Files.Interop.FileSyncProviderClass.Initialize(Guid& guidReplicaId, String pcszReplicaRootPath, String pcszMetadataFilePath, String pcszTempDirectoryPath, FILESYNC_INIT_FLAGS dwSyncFlags, IFileSyncScopeFilter pScopeFilter, IFileSyncProviderCallback pCallback)
       at Microsoft.Synchronization.Files.FileSyncProvider..ctor(SyncId replicaId, String rootDirectoryPath, FileSyncScopeFilter scopeFilter, FileSyncOptions fileSyncOptions, String metadataDirectoryPath, String metadataFileName, String tempDirectoryPath)
       at Microsoft.Synchronization.Files.FileSyncProvider..ctor(SyncId replicaId, String rootDirectoryPath, FileSyncScopeFilter scopeFilter, FileSyncOptions fileSyncOptions)
       at FileSyncProviderSample.DetectChangesOnFileSystemReplica(SyncId replicaId, String replicaRootPath, FileSyncScopeFilter filter, FileSyncOptions options) in C:\Program Files\Microsoft Sync Framework\v1.0\Samples\FileSyncProviderManagedSample\CS\SyncMain.cs:line 67
       at FileSyncProviderSample.Main(String[] args) in C:\Program Files\Microsoft Sync Framework\v1.0\Samples\FileSyncProviderManagedSample\CS\SyncMain.cs:line 42


    I am using the FileSyncProvider Sample provided when you download the Sync Framework CTP1
    Monday, March 3, 2008 1:44 AM

Answers

  • I just needed SQL Server Compact Edition 3.1 installed on my system in order for it to work.
    Monday, March 3, 2008 2:48 PM