jeraldo jeraldo - 3 years ago 141
reST (reStructuredText) Question

DataMember could not be found

As I have done my research regarding this problem of mine, I still have no luck in solving my error of Error 1 The type or namespace name 'DataMember' could not be found (are you missing a using directive or an assembly reference?)

I have come across a solution stating that I should reference System.Runtime.Serialization but still I am having no luck even when add reference to it.

Here is my code:

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace WebServApp
public class Employee
public int EmpNo { get; set; }
public string EmpName { get; set; }
public int DeptNo { get; set; }
public int Salary { get; set; }

and this is the tutorial that I am actually trying to follow:

Can anyone help me with this error?

Answer Source

I have solved the problem. I just removed the System.Runtime.Serialization in the references in the project explorer and addded it by browsing then it worked. Weird.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download