locked
Error: TargetInvocationException/ArgumentException RRS feed

  • Question

  • Hi all,
    I've followed step by step the codecast based on this walktrough: http://msdn.microsoft.com/en-us/library/cc488004.aspx
    but I've an error. When I try to synchronize I get this error:
    TargetInvocationException/ArgumentException

    Any advice for this?
    Thanks in advance.

    Best regards,
    Alessio
    • Moved by Hengzhe Li Friday, April 22, 2011 2:39 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, June 26, 2009 9:20 AM

Answers

  • hi

    if ur using WCF then edit ur proxy class....as follow

    1. Build the WCF Service Library project.
    2. Start a command prompt, move to the Bin\Debug directory of the WCF Service Library project, and then run the following commands in sequence:
      netcfsvcutil.exe  WCF_Service_Library_name.dll
      netcfsvcutil *.wsdl *.xsd /language:C# /out:MobileSyncServiceProxy.cs
      The first command generates the metadata documents for Service Contracts and associated types in the WCF Service assembly and the second uses the metadata documents as input to generate the C# code for the client proxy. If you are working in Microsoft Visual Basic®, use /language:VB /out:filename.vb arguments instead.
    3. There will be two source files generated, CFClientBase.cs/.vb and MobileSyncServiceProxy.cs/.vb. Copy these files to the Smart Device project directory and add them to the project.
    4. Add references to System.Runtime.Serialization and System.ServiceModel to the Smart Device project.
    5. Before you can use these classes, you must edit the generated MobileSyncServiceProxy.cs/.vb and remove some class definitions. The problem is that the NetCFSvcUtil tool has generated classes for every type exposed by the Service interface. This includes many types such as SyncGroupMetadata, SyncAnchor, and so on, that are also defined in the Microsoft.Synchronization.Data.dll assembly which is already referenced by the client-side project.
    6. Edit this file and delete all classes that use names that begin with Sync and the ConflictType enum. Add a using Microsoft.Synchronization.Data; (Imports Microsoft.Synchronization.Data for Visual Basic) statement to the top of this file and then you can compile successfully.

    hope it will help u.....

    Friday, July 17, 2009 11:22 AM

All replies

  • HI,

    Take a look at following link . Adding web reference directlñy using VS is not correct at all. You can see an implementation here .

    Cheers
    José Miguel Torres
    Friday, June 26, 2009 1:12 PM
  • Hi,
    thanks for your answer. But if I follow exactly the steps provided by the codecast I get these errors?How can it be possible?
    Friday, June 26, 2009 4:16 PM
  • If may be helpful I made a print screen of an error related to this.
    Free Image Hosting at www.ImageShack.us

    QuickPost Quickpost this image to Myspace, Digg, Facebook, and others!
    • Edited by NuSYS Monday, June 29, 2009 3:27 PM
    Monday, June 29, 2009 3:26 PM
  • Anybody can help me please?
    Tuesday, June 30, 2009 2:25 PM
  • Urgent help needed, please.

    Friday, July 10, 2009 7:00 AM
  • hi

    if ur using WCF then edit ur proxy class....as follow

    1. Build the WCF Service Library project.
    2. Start a command prompt, move to the Bin\Debug directory of the WCF Service Library project, and then run the following commands in sequence:
      netcfsvcutil.exe  WCF_Service_Library_name.dll
      netcfsvcutil *.wsdl *.xsd /language:C# /out:MobileSyncServiceProxy.cs
      The first command generates the metadata documents for Service Contracts and associated types in the WCF Service assembly and the second uses the metadata documents as input to generate the C# code for the client proxy. If you are working in Microsoft Visual Basic®, use /language:VB /out:filename.vb arguments instead.
    3. There will be two source files generated, CFClientBase.cs/.vb and MobileSyncServiceProxy.cs/.vb. Copy these files to the Smart Device project directory and add them to the project.
    4. Add references to System.Runtime.Serialization and System.ServiceModel to the Smart Device project.
    5. Before you can use these classes, you must edit the generated MobileSyncServiceProxy.cs/.vb and remove some class definitions. The problem is that the NetCFSvcUtil tool has generated classes for every type exposed by the Service interface. This includes many types such as SyncGroupMetadata, SyncAnchor, and so on, that are also defined in the Microsoft.Synchronization.Data.dll assembly which is already referenced by the client-side project.
    6. Edit this file and delete all classes that use names that begin with Sync and the ConflictType enum. Add a using Microsoft.Synchronization.Data; (Imports Microsoft.Synchronization.Data for Visual Basic) statement to the top of this file and then you can compile successfully.

    hope it will help u.....

    Friday, July 17, 2009 11:22 AM