This project is read-only.

No DataContract attribute added

Oct 1, 2009 at 12:57 PM


Firstly, thanks for developing - and making open source - your product. It looks fantastic!

I'm experiementing with your software - trying to generate data contracts from xsd - and I noticed that the generated code does not contain a [DataContract()] class attribute or DataMember.

Is this an error, or am I misunderstanding something?



Oct 1, 2009 at 1:45 PM
Edited Oct 1, 2009 at 1:47 PM v1 currently always generates XmlSerializer-compatible types. The DataContract feature (i.e. DataContractSerializer) does not support a lot of XSD constructs (by design), so falling back to XmlSerializer is the safest way to guarantee proper code generation.

We are thinking about enhancing the code generation engine to first try to create [DataContract] code, and if it fails to fall back to XmlSerializer.




Oct 1, 2009 at 2:44 PM

Hi Christian

Thanks for the reply.

I found this nice comparison between the two serializers, if anyone is interested.