System.Runtime.Serialization.DataContractAttribute does not exist in the System.Runtime.Serialization namespace

I am doing WCF work and I do not understand why I came across this error.

System.Runtime.Serialization.DataContractAttribute does not exist in the namespace

 System.Runtime.Serialization 

The Microsoft documentation clearly shows this hierarchy.

 System.Object System.Attribute System.Runtime.Serialization.ContractNamespaceAttribute 

Does anyone know what is going on?

+6
source share
1 answer

Make sure that you add a reference to the System.Runtime.Serialization assembly in your project.

+29
source

Source: https://habr.com/ru/post/893444/


All Articles