Search code examples
c#.netwcfdatacontractserializer

Why does DataContractSerializer Generate a node with the name : "z:anytype"?


When working with the DataContractSerializer I am getting alot of extra attributes for namespaces that I dont really want to work with. I have generated a similar data structure in a different project without all the extra markup so I know its possible.

Why does DataContractSerializer Generate a node with the name : "z:anytype" ?


Solution

  • My problem was that I was passing an interface as a type to my DataContractSerializer.

    It was easy to miss because my interface was named IInvestment.

    If you ever have this issue check the type that you are passing to the DataContractSerializer Constructor.