Search code examples
c#sql-serversql-server-2008synchronizationmicrosoft-sync-framework

Microsoft.Synchronization.Data.DbSyncException: Cannot enumerate changes at the RelationalSyncProvider for table


I am working with MS Sync framework 2.1 and using sql server 2008 as client side and sql server 2012 as server side.

some time I am getting below error

Microsoft.Synchronization.Data.DbSyncException: Cannot enumerate changes at the RelationalSyncProvider for table 'MyTable'. Check the inner exception for any store-specific errors. ---> System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'ISyncKnowledge'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{615BBB53-C945-4203-BF4B-2CB65919A0AA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) at Microsoft.Synchronization.CoreInterop.ISyncKnowledge.Clone() at Microsoft.Synchronization.SyncKnowledge.Clone() at Microsoft.Synchronization.Data.RelationalSyncProvider.GetRowEnumerationState(DbDataReaderHandler readerHandler, SyncKnowledge knowledgeToCompare) at Microsoft.Synchronization.Data.RelationalSyncProvider.EnumerateChangesInBatchesInternal(Object batchProducer) --- End of inner exception stack trace --- at Microsoft.Synchronization.Data.DbSyncBatchProducer.DequeueBatch() at Microsoft.Synchronization.Data.RelationalSyncProvider.ConsumeBatchFromProducer(DbSyncScopeMetadata scopeMetadata) at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChanges(DbSyncScopeMetadata scopeMetadata, DbSyncSession DbSyncSession, UInt32 memoryBatchSize) at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChangeBatch(UInt32 batchSize, SyncKnowledge destinationKnowledge, Object& changeDataRetriever) at Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize, ISyncKnowledge pSyncKnowledge, ISyncChangeBatch& ppChangeBatch, Object& ppUnkDataRetriever) at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics) at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed) at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed) at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize() at Microsoft.Synchronization.SyncOrchestrator.Synchronize() at UNIVERSALCONSTRUCTION.Classes._cSynchronization.Synchronize(String _pScopeName, SyncDirectionOrder _pDirection) at SyncUtility.FrmSync._MSync() at SyncUtility.FrmSync.button1_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

this application running on three different pc at same time and getting same error on two pcs, but one pc don't get error and working fine..

any suggestion.. how to solve this..

here inner exception.

{"Unable to cast COM object of type 'System.__ComObject' to interface type 'ISyncKnowledge'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{615BBB53-C945-4203-BF4B-2CB65919A0AA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."}


Solution

  • if you have SyncFx installed on those machine, make sure that the target platform for your app matches the SyncFx platform installed.

    e.g., x86 version of SyncFx, you app should target x86 as well.