Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - cannot resolve symbol ' datacontract'

 
 
Old 07-12-2006   #1 (permalink)
R.A.B


 
 

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 SpecsSystem Spec
Old 07-12-2006   #2 (permalink)
Joseph Bittman MVP MCSD


 
 

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 SpecsSystem Spec
Old 07-13-2006   #3 (permalink)
Arkady Frenkel


 
 

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 SpecsSystem Spec
Old 07-13-2006   #4 (permalink)
R.A.B


 
 

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 SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46