Namespace for [DataContract]

前端 未结 6 2163
一个人的身影
一个人的身影 2020-11-30 18:39

I can\'t find the namespace to use for [DataContract] and [DataMember] elements. According to what I\'ve found, it seems that adding the following

6条回答
  •  再見小時候
    2020-11-30 19:13

    DataContractAttribute Class is in the System.Runtime.Serialization namespace.

    You should add a reference to System.Runtime.Serialization.dll. That assembly isn't referenced by default though. To add the reference to your project you have to go to References -> Add Reference in the Solution Explorer and add an assembly reference manually.

提交回复
热议问题