locked
Update my project from Sync services for ADO.NET v1 to v2? RRS feed

  • Question

  • I usea Sql CE 3.5 im my project to store content for my application. I used Sync frameword for ADO.Net v1 when I developed the project. With v1 I did not get the SyncStage.DownloadingChanges in my SyncProgressEventArgs.

    Now when v2 is released I want to update my project to that version. I Deleted my references to Microsoft.Synchronization.Data version 1.0.0.0 and Microsoft.Synchronization.Data.Server version 1.0.0.0 in both my Client and server projects. I then added Microsoft.Synchronization.Data version 2.0.0.0 and Microsoft.Synchronization.Data.Server version 2.0.0.0. I got alot of errors. One that says

     

    The type 'Microsoft.Synchronization.SyncProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Synchronization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.

     

    Has this type moved?

    I add a reference to the assembly and the error is gone.

     

    But I have another one that says

     

    Error 19 Assembly 'MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Synchronization.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' which has a higher version than referenced assembly 'Microsoft.Synchronization.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' PathToTheAssembly MyProjectName

     

    Please can anyone tell me how to update from Sync services for ADO.NET v1 to v2?

    /Christer

    • Moved by Max Wang_1983 Friday, April 22, 2011 4:57 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, September 22, 2008 10:08 AM

Answers

  • V2 enabled support for Peer to peer in addition to hub-spoke. The hub-spoke classes (DbServerSyncProvider and SqlCeClientSyncProviders) and still intact in V2. Your original solution was correct (i.e delete 1.0.0.0 references to Microsoft.Synchronizaiton.data and Microsoft.Synchronization.Data.Server and add back 2.0.0.0 references). You need the Microsoft.Synchronization as V2 is based on Microsoft Sync Framework which resides in the Microsoft.Synchronization.dll.

    Regarding the final error about "

    Error 19 Assembly 'MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Synchronization.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' which has a higher version than referenced assembly 'Microsoft.Synchronization.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' PathToTheAssembly MyProjectName

    " this is because your assembly references another project which still references the old 1.0.0.0 version of Microsoft.Synchronization.Data.dll. Please change all references of Microsoft.Synchronization.data/.Server.dll in your projects and sub projects and recompile and the errors should go away.

     

    Please post back if you continue to see errors.

    Tuesday, September 23, 2008 5:41 PM
    Moderator

All replies

  • V2 is not a upgraded version of V1.

    V1 is for hub-spoke (or client server) sync application.

    V2 is for Peer-to-Peer sync application.

     

    Thanks.

    Tuesday, September 23, 2008 12:36 AM
    Answerer
  •  

    Now, I am confused!!

    V2 is not an upgrade of V1?

    Why did you use the same name fore the assembly? So if I want a peer to peer sync I will use V2 and if a want a client to server sync I use V1? What if I want both?

    Does this means that I still not going to get the SyncProgressEventArgs with SyncStage.DownloadingChanges in my

    SyncProgress EventHandler when downloading my changes from the server?

     

    /Christer

    Tuesday, September 23, 2008 5:32 AM
  • V2 enabled support for Peer to peer in addition to hub-spoke. The hub-spoke classes (DbServerSyncProvider and SqlCeClientSyncProviders) and still intact in V2. Your original solution was correct (i.e delete 1.0.0.0 references to Microsoft.Synchronizaiton.data and Microsoft.Synchronization.Data.Server and add back 2.0.0.0 references). You need the Microsoft.Synchronization as V2 is based on Microsoft Sync Framework which resides in the Microsoft.Synchronization.dll.

    Regarding the final error about "

    Error 19 Assembly 'MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Synchronization.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' which has a higher version than referenced assembly 'Microsoft.Synchronization.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' PathToTheAssembly MyProjectName

    " this is because your assembly references another project which still references the old 1.0.0.0 version of Microsoft.Synchronization.Data.dll. Please change all references of Microsoft.Synchronization.data/.Server.dll in your projects and sub projects and recompile and the errors should go away.

     

    Please post back if you continue to see errors.

    Tuesday, September 23, 2008 5:41 PM
    Moderator
  • I missed one reference.

    Thanks alot!

    Tuesday, September 23, 2008 8:37 PM