The type or namespace name ‘DataContractAttribute’ could not be found (are you missing a using directive or an assembly reference?)

Posted: August 28, 2011 in WCF
Tags: ,

A small tip for you..If you come across this error,The type or namespace name ‘DataContractAttribute’ could not be found (are you missing a using directive or an assembly reference?) make sure that you add the reference to dll System.Runtime.Serialization and refer the namespace.

Advertisements
Comments
  1. Daniel Rabe says:

    Thanks!

  2. Matt Fielder says:

    Another issue that can cause this:
    I’m currently using some WCF examples from a book. When I brought the sample projects into Visual Studio (2013), I didn’t realize they were set to use .Net framework 2.0, which won’t work since the classes don’t exist in less than V3.0. I had to set the framework version manually, and viola, all works as expected.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s