locked
SyncKnowledge object not being passed to WCF service RRS feed

  • Question

  • Hi

    I am trying to sync a SQLCE database with SQL database using WCF. I have a proxy which inherits from KnowledgeSyncProvider. I override the below method (among others)

     

     

    public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)

    {

     

     

    GetChangesParameters changesWrapper = proxy.GetChanges(batchSize, destinationKnowledge);

    ...

    }

    When the GetChangesParameters changesWrapper = proxy.GetChanges(batchSize, destinationKnowledge); code is executed, I get the following error

    Retrieving the COM class factory for component with CLSID {EC413D66-6221-4EBB-AC55-4900FB321011} failed due to the following error: 80040154.

    Stack trace:


    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at WCF_Sync_Common.IRelationalSyncContract.GetChanges(UInt32 batchSize, SyncKnowledge destinationKnowledge)
       at ConsoleApplication10.RelationalProviderProxy.GetChangeBatch(UInt32 batchSize, SyncKnowledge destinationKnowledge, Object& changeDataRetriever) in C:\Users\amitesh.AKL\Documents\Visual Studio 2010\Projects\ConsoleApplication10\RelationalProviderProxy.cs:line 81
       at Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize, ISyncKnowledge pSyncKnowledge, ISyncChangeBatch& ppChangeBatch, Object& ppUnkDataRetriever)

    Seems like the error has something to do with the SyncKnowledge object when passing it over the wire. I tried to call the proxy method without the SyncKnowledge object and was able to call the method. But as soon as I include the object I get the above error. Can anybody explain to point me in the right direction on what I am missing

    Tuesday, March 8, 2011 10:24 PM

Answers

  • try this,

    on your Windows Service project, check the Platform Target under Project Properties->Build to match the Sync Fx platform you installed (x86 or x64)

    Wednesday, March 9, 2011 3:44 AM

All replies

  • check your Sync Fx installation. as per docs:

    Managed Application Throws System.Runtime.InteropServices.COMException (0x80040154)

    A managed synchronization application throws System.Runtime.InteropServices..::..COMException with the following error message: "Retrieving the COM class factory for component with CLSID {565AEDBF-3108-4405-AF1F-9C2C25925DAE} failed due to the following error: 80040154

    This exception occurs when an unmanaged synchronization component, such as Synchronization.dll, is missing from the installation. This can occur when Sync Framework has been uninstalled or when installation was not completed successfully.

    Solution

    Reinstall Sync Framework. Sync Framework can be downloaded from this Microsoft Web site.

    Tuesday, March 8, 2011 11:30 PM
  • I managed to solve the issue by creating a WCF Service Application project and moving all the WCF code into that project. My initial WCF project was just a normal console application

    Tuesday, March 8, 2011 11:49 PM
  • The fix that I suggested only seems to work in development. I hosted the project in a Windows Service and installed it and now I am back to square one but with a slightly different msg

    Retrieving the COM class factory for component with CLSID {EC413D66-6221-4EBB-AC55-4900FB321011} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    Any hints anybody. BTW June, I have reinstalled Sync Framework which did not help

    Wednesday, March 9, 2011 3:02 AM
  • try this,

    on your Windows Service project, check the Platform Target under Project Properties->Build to match the Sync Fx platform you installed (x86 or x64)

    Wednesday, March 9, 2011 3:44 AM
  • Thanks

    Friday, January 6, 2017 8:05 AM