Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

cannot resolve symbol ' datacontract'

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 07-12-2006   #1 (permalink)
R.A.B
Guest


 

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
Guest


 

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
Guest


 

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
Guest


 

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
Display Modes




Vistax64.com 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 2005-2008

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 47 48 49 50 51