![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | cannot resolve symbol ' datacontract' Im designing a service using vs 2005 I have made a interface using ServiceContract.... no problem Then i try to add some data contracts using System; using System.Collections.Generic; using System.Text; using IECServer.Datatypes; namespace IECServer.Request { [DataContract(Namespace="somenamespace")] public class MyData { [DataMember] public string Name; [DataMember] public int? ID; [DataMember] public DateTime StartDate; } } But visual studio flags an error saying cannot resolve symbol ' DataContract' and the same for DataMembers This ofcause results in a non compilable code MessageContracts works fine too.... I have installed .. net 3.0 orcas Anyone got a idea why. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: cannot resolve symbol ' datacontract' July 12, 2006 I'm not familiar with the error codes in C#, but for VB I believe you are getting the "[objectname] is not defined". In your Using statements you need to be using some more namespaces.... ServiceContract is defined under the System.ServiceModel namespace (must add reference to this assembly to the project)... and DataContract/Member classes are defined under System.Runtime.Serialization (I don't remember whether you need to add a reference to the system.runtime.serialization assembly). Try adding those namespaces and see what happens - hope this helps! :-) -- Joseph Bittman Microsoft Certified Solution Developer Microsoft Most Valuable Professional -- DPM Web Site/Blog: http://CactiDevelopers.ResDev.Net/ "R.A.B" <akolsen@gmail.com> wrote in message news:1152711137.329920.160560@35g2000cwc.googlegroups.com... > Im designing a service using vs 2005 > > I have made a interface using ServiceContract.... > no problem > > Then i try to add some data contracts > > using System; > using System.Collections.Generic; > using System.Text; > using IECServer.Datatypes; > > namespace IECServer.Request { > [DataContract(Namespace="somenamespace")] > public class MyData { > [DataMember] > public string Name; > [DataMember] > public int? ID; > [DataMember] > public DateTime StartDate; > } > } > > But visual studio flags an error saying > cannot resolve symbol ' DataContract' > and the same for DataMembers > This ofcause results in a non compilable code > > MessageContracts works fine too.... > > I have installed > . net 3.0 > orcas > > Anyone got a idea why. > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: cannot resolve symbol ' datacontract' Did you try examples with DataContract from Platform SDK ? Just a hint Arkady "R.A.B" <akolsen@gmail.com> wrote in message news:1152711137.329920.160560@35g2000cwc.googlegroups.com... > Im designing a service using vs 2005 > > I have made a interface using ServiceContract.... > no problem > > Then i try to add some data contracts > > using System; > using System.Collections.Generic; > using System.Text; > using IECServer.Datatypes; > > namespace IECServer.Request { > [DataContract(Namespace="somenamespace")] > public class MyData { > [DataMember] > public string Name; > [DataMember] > public int? ID; > [DataMember] > public DateTime StartDate; > } > } > > But visual studio flags an error saying > cannot resolve symbol ' DataContract' > and the same for DataMembers > This ofcause results in a non compilable code > > MessageContracts works fine too.... > > I have installed > . net 3.0 > orcas > > Anyone got a idea why. > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: cannot resolve symbol ' datacontract' Thank you for your help. I already had the referance added to the seviceModel, but the problem was the System.Runtime.Serialization module I was suppose to add. The book I used just forgot to tell me that it was a seperate namespace for DataContract. |
My System Specs![]() |