locked
Sync Services for ADO.NET 2.0 : Samples code use v1.0 !??? RRS feed

  • Question

  • Hi,

     

    urgent !


    I'm struggling to play with CTP1 bits;

    all samples included inside "C:\Program Files\Microsoft Sync Framework\v1.0\Runtime\ADO.NET\V2.0\Samples] still use version 1.0 of Microsoft.Synchronization.Data.dll and a lot of code must be changed to make it work with the v2.0.

     

    Anyone having a one good sample which use the new CTP1 bits ?

     

     

    Thxs
    Regards
    -Vince


     

     

    • Moved by Max Wang_1983 Friday, April 22, 2011 8:37 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, December 17, 2007 5:30 PM

All replies

  •  

    Vince,

     

    I took a look and validated that the correct version of the dlls (v2.0.50727) is being included with the samples.  Have you downloaded CTP1 refresh by any chance? Could you validate that the assembly being referenced in the project is in fact the same assembly that is being loaded.  In addition, more details would help here including the following:

     

    -What version of Sync Services for ADO.NET are you using (i.e. v1 which ships with VS 2008 or v2 CTP1 refresh which is available as download only

    -What version of SQL CE?

    -Which sample are you trying to run

    -Version of the .NET framework being used

     

    Thanks,

     

    Sean

    Friday, February 1, 2008 7:49 PM
    Moderator
  • Hello,

     

    I have downloaded both version of the syncservices and the sample e.g. SharingAppDemo-Conflicts.csproj references the Microsoft.Synchronization.Data.dll from v1 Path: [ProgramFiles]\Microsoft Synchronization Services\ADO.NET\v1.0\Microsoft.Synchronization.Data.dll. Dereferencing the dll and referencing the right version solves the problem.

     

    I had another problem using code from the documentation of CTP1. 

    Link: http://msdn2.microsoft.com/en-us/library/bb726037(SQL.100).aspx "How to: Initialize the client database.." located under Microsoft Sync Framework:

     

    Sample (from documentation):

    public class SampleSyncAgent : SyncAgent
        {
            public SampleSyncAgent()
            {

    ....

    SyncTable customerSyncTable = new SyncTable("Customer");
    customerSyncTable.CreationOption = TableCreationOption.UseExistingTableOrFail;
    customerSyncTable.SyncDirection = SyncDirection.Bidirectional;
    customerSyncTable.SyncGroup = customerSyncGroup;
    this.Configuration.SyncTables.Add(customerSyncTable);

    it should be:

    SyncTable customerSyncTable = new SyncTable("Customer");

    customerSyncTable.CreationOption = TableCreationOption.UseExistingTableOrFail;

    customerSyncTable.SyncTableTransferOption = SyncTableTransferOption.Bidirectional;

    customerSyncTable.SyncGroup = customerSyncGroup;

    clientSyncProvider.Configuration.SyncTables.Add(customerSyncTable);

     

    So the Configuration object seems to has moved from the SyncAgent to the clientSyncProvider and some enumeration have been renamed ( mostly the changes are easy to identify if you have to adopt your code) 

    I think the samples in the documentation should be updated.

     

    Regards

    Thomas


     

    Monday, February 4, 2008 10:23 AM
  • Double checked one more time and verified that the SharingAppDemo-Conflicts.csproj is referencing the correct DLL so I'm not sure how you ran into this issue.  Did you install Sync Services for ADO.NET v2 first? 

     

    Good catch on the documentation and there is already a bug filed for this.  You are correct, for CTP1 the configuration moved from the SyncAgent to the client provider.  However, for CTP2 and RTM, we are adding the Configuration property back to SyncAgent so this sample will work as expected.  I apologize for the confusion.

     

    -Sean

     

    Monday, February 4, 2008 7:35 PM
    Moderator
  • Hello Sean,

     

    not worth bothering the dll reference (anyway easy to resolve).

    when will ctp2 be released? changes and new features?  

     

    -Thomas 

     

    Tuesday, February 5, 2008 7:02 AM
  • CTP2 will be available in March.

     

    -Sean

    Wednesday, February 20, 2008 5:49 PM
    Moderator