Why is WCF suddenly requiring DataContractAttributes? -


i built number of wcf services part of application. until recently, of classes used parameters of many operations in service did not had datacontract or datamember attributes applied them.

now, i've made few changes in row , of sudden wcf complaining can't serialize classes.

does knows if changes in configuration or in servicecontract, operationcontract etc. can cause wcf become picky classes can serialize?

i'd rather not need attributes in classes (they should pure c# classes possible).

also of note, if return previous version in source control, wcf goes "normal", believe it's not machine/environment thing.

the ability create wcf data contracts without use of [datacontract] , [datamember] attributes feature added wcf in .net 3.5 sp1. since works when reverting code previous version, i'm assuming using @ least version.

nevertheless, in order classes serializable wcf, class must meet several requirements listed here. main requirements of data contract class are:

  • it must public.
  • it must have parameterless constructor.
  • it must not have data members not meet these requirements. if have such member, mark [ignoredatamember] , excluded wcf serialization.

you can more information fails serialize performing serialization manually using datacontractserializer class. see this article more details , code examples. method mark members [ignoredatamember] , gradually remove attributes members until serialization fails, tell member causing problem.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -