ich hoffe ich bin jetzt im richtigen Bereich.
Ich habe versucht, mir ein simples Programm zu schreiben, um 2 Ordner miteinander zu synchronisieren. Der Code schaut wie folgt aus:
FileSyncProvider source = new FileSyncProvider(@"*pfad*\test\src");
FileSyncProvider destination = new FileSyncProvider(@"*pfad*\test\dest");
SyncOrchestrator syncOrch = new SyncOrchestrator();
syncOrch.LocalProvider = source;
syncOrch.RemoteProvider = destination;
syncOrch.Direction = SyncDirectionOrder.UploadAndDownload;
syncOrch.Synchronize();
Allerdings gibt er mir bereits in der ersten Zeile folgenden Fehler aus:
Fehler |
System.Runtime.InteropServices.COMException was unhandled Message=Retrieving the COM class factory for component with CLSID {031913FE-EB2A-49F2-B2BE-B996B2448CD4} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Source=Microsoft.Synchronization.Files ErrorCode=-2147221164 StackTrace: at Microsoft.Synchronization.Files.FileSyncProvider..ctor(Guid replicaId, String rootDirectoryPath, FileSyncScopeFilter scopeFilter, FileSyncOptions fileSyncOptions, String metadataDirectoryPath, String metadataFileName, String tempDirectoryPath, String pathToSaveConflictLoserFiles) at Microsoft.Synchronization.Files.FileSyncProvider..ctor(String rootDirectoryPath) at Sync.Program.Main(String[] args) in C:\Users\Andy\AppData\Local\Temporary Projects\Sync\Program.cs:line 14 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: |
Im Internet finde ich leider nichts dazu. In meiner Verzweiflung habe ich dann das Beispiel von msdn 1 zu 1 kopiert und es damit versucht, aber auch das geht nicht. Habe ich etwas übersehen?
Vielen Dank und lg,
Bernie