Answered How to pass an observablecollection to the client?

  • Saturday, February 11, 2006 10:43 AM
     
     
    I have an operationcontract which returns a collection say observablecollection<Product>. But when I generate the proxy on client, I get Product[] instead of observablecollection. So, is there any convient way to avoid that?

All Replies

  • Saturday, February 11, 2006 4:56 PM
    Moderator
     
     Answered

    Please try the following

    svcutil /rct:System.Collections.ObjectModel.ObservableCollection YourWsdl

    For more information please see svcutil /?

    Hope this helps

     

  • Monday, February 13, 2006 12:36 PM
     
     
    yes, I get it.
  • Friday, February 24, 2006 3:30 PM
     
     

    Hi,

    I am trying this on the Jan CTP and I get "no type could be loaded for System.Collections.ObjectModel.ObservableCollection"

    If I referance C:\WINDOWS\microsoft.net\windows\v6.0.5070\WindowsBase.dll

    It still breaks

    Any clues?

    Andy

  • Tuesday, February 28, 2006 1:36 PM
     
     

    Hi,

    I am running the following.

     svcutil /d:ServiceProxy /r:C:\Progra~1\Refere~1\Microsoft\WinFX\v3.0\WindowsBase.dll /rct:System.Collections.ObjectModel.ObservableCollection test\bin\Debug\test.dll

    Where test.dll is my service contract.

     I get the following.

     Error: No type could be loaded for the value System.Collections.ObjectModel.ObservableCollection passed to the /referenceCollectionType option. Please ensure that the assembly this type belongs to is specified via the /reference option.

     It’s loading the WindowsBase.dll ok; if I break the path it gives me a Fusion error so I know it’s loading the assembly ok.

    Andy

  • Tuesday, February 28, 2006 3:10 PM
     
     

    Hi,

    I after a lot of trail and error I run into this post

    http://steve.emxsoftware.com/Indigo-WCF/HowDoIGetSvcutilToUseGenericListsForProxies

    When applied to WPF OC you need to use

    /rct:System.Collections.ObjectModel.ObservableCollection`1 /r:C:\Progra~1\Refere~1\Microsoft\WinFX\v3.0\WindowsBase.dll

    Andy