none
Error in WCF, not sure what it means... RRS feed

  • Question

  • Hi...

    I am quite new to WCF work and finding it well, frustrating.  Specifically, I have to move some data from a WCF client-side Lib, to a Web Service, server side lib.  When I first started engineering this I wanted to use a DataTable, but when I started reviewing web posts about this it was astonishing - half of them said "No, you cant use a DataTable" and the other half said "Yes, you can use a Data Table".  Long story short, we finally dumped the Data Table idea and are now trying to use a Collection.  This works just as well as any Data Table and I found a Microsoft post that said "No problem - Collections are fully supported."  Well, if they are I don't see how as I continually get this error each time I build...

    To be XML serializable, types which inherit from ICollection must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. Microsoft.VisualBasic.Collection does not implement Add(System.Object).

    Put simply, what the heck does that mean???  "At all levels"???  Levels of what??? 

    I have been scoping the web for a couple days now trying to decipher what this means, and what do I do to take care of it.  I thought of adding a Data Contract to address this, but since I cannot build the service, I have no assembly to use SVCUTIL against.

    It almost seems as though I have created the perfect storm - Can anyone give me some advice on how I can fix this problem? And if the Collection type is "supported", as the Microsoft documentation says it is, why am I running into this since a collection already has an Add function???

    This is totally confusing - can anyone shed some light for me?  Thanks!

    Wednesday, July 10, 2013 3:28 PM

Answers

  • I resolved this one on my own finally finding that my collection was not referenced properly.  That is, I neglected to use the "List of" syntax, and instead used "collection".  As soon as I changed from collection to List of, everything looks good, no errors.

    My bad!

    • Marked as answer by B_E_L Wednesday, July 10, 2013 4:38 PM
    Wednesday, July 10, 2013 4:38 PM

All replies

  • I resolved this one on my own finally finding that my collection was not referenced properly.  That is, I neglected to use the "List of" syntax, and instead used "collection".  As soon as I changed from collection to List of, everything looks good, no errors.

    My bad!

    • Marked as answer by B_E_L Wednesday, July 10, 2013 4:38 PM
    Wednesday, July 10, 2013 4:38 PM
  • Hi,

    I am very glad that you have solved your problem by yourself.

    If you have any other problem, welcome to post your question in wcf forums.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 11, 2013 5:24 AM
    Moderator