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.
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx
DataContractAttribute is in System.Runtime.Serialization namespace and you should reference System.Runtime.Serialization.dll. It's only available in .Net >= 3
In visual studio for .Net 4.0 framework,
System.Runtime.Serialization
. using System.Runtime.Serialization
. And the error will not be shown. [DataContract] and [DataMember] attribute are found in System.ServiceModel namespace which is in System.ServiceModel.dll .
System.ServiceModel uses the System and System.Runtime.Serialization namespaces to serialize the datamembers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With