0

I am working on a project and I need to include [DataMember] and [DataContract] in my code but when I do that these attributs could not be found.

Is there a "Using" or a reference that I should include for these to work?

Thanks for you help!

RoyNasr
  • 359
  • 1
  • 3
  • 15
  • What project type are you using? What visual studio version are you using? DataMember belongs to System.Runtime.Serialization. Try to right click on DataMember and choose Resolve (if you're using recent visual studio, there will be a lightbulb). See If visual studio helps you in that way – Renato Afonso Jun 27 '17 at 10:48
  • I am using vs 2017 and I tried using the lightbulb but it says that I most generate a new class named DataMember, and that's not the case. I also tried "using System.Runtime.Serialization;" but it also didn't work – RoyNasr Jun 27 '17 at 10:58
  • 1
    You didn't mention which project type you're using. Try right click on the project- > Add reference , and look for the System.Runtime.Serialization Dll. Only then is when that lightbulb will work. – Renato Afonso Jun 27 '17 at 11:09
  • Sorry I forgot to mention that the project type is "ASP.NET Web Application" and when I added the reference you told me about it worked. Thanks a lot @RenatoAfonso – RoyNasr Jun 27 '17 at 11:19

0 Answers0