user3458266
user3458266

Reputation: 245

Error on DataContractAttribute, IExtensibleDataObject, ExtensionDataObject

I got this error on my win forms 'system.Runtime.Serialization.DataContractAttrubute is not defines' same for 'IExtensibleDataObject, ExtensionDataObject'

I have the following in my app,

Imports System
Imports System.Runtime.Serialization

What I did was, I have a web service and I want to debug it, and its easier in a win form app. I copied the code and copied the web reference.

I don't know why this happens.

C# help also welcome

Upvotes: 1

Views: 3251

Answers (1)

Styxxy
Styxxy

Reputation: 7517

You are probably missing a reference to the System.Runtime.Serialization (.NET) assembly. Add it to your project as a reference and it should be all good.

You can also see this in the documentation (MSDN), that DataContractAttribute, ExtensionDataObject and IExtensibleDataObject are defined in the System.Runtime.Serialization.dll assembly.

Add it to your project reference: go to your project properties, tab "References" and press "Add", go to the tab ".NET" and look for "System.Runtime.Serialization". Now you should be good to go.

enter image description here

Upvotes: 4

Related Questions