C# - Error CS0246 - The type or namespace name 'DataMember' could not be found

If you get this error, you are missing an assembly reference.

Fix with: Project ... Add Reference ... System.Runtime.Serialization.dll

[error-cs0246.gif]

Why?

The class DataMemberAttribute, which can be found in the namespace System.Runtime.Serialization, is implemented in the assembly System.Runtime.Serialization.dll.
That assembly is not referenced by default.


Ads by Google


Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath