Microsoft.Synchronization.Data.DbSyncException:无法枚举表的RelationalSyncProvider上的更改

时间:2015-03-11 15:13:07

标签: c# sql-server sql-server-2008 synchronization microsoft-sync-framework

我正在使用MS Sync framework 2.1并使用sql server 2008作为客户端,sql server 2012作为服务器端。

有段时间我遇到错误

  

Microsoft.Synchronization.Data.DbSyncException:无法枚举表'MyTable'的RelationalSyncProvider的更改。检查内部异常是否存在任何特定于商店的错误。 ---> System.InvalidCastException:无法将类型为“System .__ ComObject”的COM对象强制转换为接口类型“ISyncKnowledge”。此操作失败,因为对IID为“{615BBB53-C945-4203-BF4B-2CB65919A0AA}”的接口的COM组件的QueryInterface调用由于以下错误而失败:不支持此类接口(HRESULT异常:0x80004002(E_NOINTERFACE)) 。      在System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc,IntPtr pCPCMD,IntPtr& ppTarget,Boolean& pfNeedsRelease)      在Microsoft.Synchronization.CoreInterop.ISyncKnowledge.Clone()      在Microsoft.Synchronization.SyncKnowledge.Clone()      在Microsoft.Synchronization.Data.RelationalSyncProvider.GetRowEnumerationState(DbDataReaderHandler readerHandler,SyncKnowledge knowledgeToCompare)      在Microsoft.Synchronization.Data.RelationalSyncProvider.EnumerateChangesInBatchesInternal(Object batchProducer)      ---内部异常堆栈跟踪结束---      在Microsoft.Synchronization.Data.DbSyncBatchProducer.DequeueBatch()      在Microsoft.Synchronization.Data.RelationalSyncProvider.ConsumeBatchFromProducer(DbSyncScopeMetadata scopeMetadata)      在Microsoft.Synchronization.Data.RelationalSyncProvider.GetChanges(DbSyncScopeMetadata scopeMetadata,DbSyncSession DbSyncSession,UInt32 memoryBatchSize)      在Microsoft.Synchronization.Data.RelationalSyncProvider.GetChangeBatch(UInt32 batchSize,SyncKnowledge destinationKnowledge,Object& changeDataRetriever)      在Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize,ISyncKnowledge pSyncKnowledge,ISyncChangeBatch& ppChangeBatch,Object& ppUnkDataRetriever)      在Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy,_SYNC_SESSION_STATISTICS& pSyncSessionStatistics)      在Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats,SyncIdFormatGroup destinationIdFormats,KnowledgeSyncProviderConfiguration destinationConfiguration,SyncCallbacks DestinationCallbacks,ISyncProvider sourceProxy,ISyncProvider destinationProxy,ChangeDataAdapter callbackChangeDataAdapter,SyncDataConverter conflictDataConverter,的Int32&安培; changesApplied,的Int32&安培; changesFailed)      在Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter,SyncDataConverter destinationConverter,SyncProvider sourceProvider,SyncProvider destinationProvider,Int32& changesApplied,Int32& changesFailed)      在Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()      在Microsoft.Synchronization.SyncOrchestrator.Synchronize()      在UNIVERSALCONSTRUCTION.Classes._cSynchronization.Synchronize(String _pScopeName,SyncDirectionOrder _pDirection)      在SyncUtility.FrmSync._MSync()      在SyncUtility.FrmSync.button1_Click(Object sender,EventArgs e)      在System.Windows.Forms.Control.OnClick(EventArgs e)      在System.Windows.Forms.Button.OnClick(EventArgs e)      在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)      在System.Windows.Forms.Control.WmMouseUp(消息& m,MouseButtons按钮,Int32点击)      在System.Windows.Forms.Control.WndProc(消息& m)      在System.Windows.Forms.ButtonBase.WndProc(消息& m)      在System.Windows.Forms.Button.WndProc(消息& m)      在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)      在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)      在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)

这个应用程序同时在三台不同的PC上运行并在两台PC上出现相同的错误,但是一台PC没有出错并且工作正常..

任何建议..如何解决这个问题..

这里是内部异常。

  

{“无法将'System .__ ComObject'类型的COM对象强制转换为接口类型'ISyncKnowledge'。此操作失败,因为对于具有IID'{615BBB53-C945-4203-BF4B-的接口的COM组件上的QueryInterface调用2CB65919A0AA}由于以下错误而失败:不支持此类接口(HRESULT异常:0x80004002(E_NOINTERFACE))。“}

1 个答案:

答案 0 :(得分:0)

如果您在这些计算机上安装了SyncFx,请确保您的应用的目标平台与安装的SyncFx平台相匹配。

例如,x86版本的SyncFx,你的app也应该以x86为目标。