Datacontract is added to datacontractset because the data contract name is also the namespace.

Source: Internet
Author: User

 

Because I used a generic data contract with the same name, an error will be reported,

 

System. invalidoperationexception: An exception occurs when calling the WSDL export Extension: system. servicemodel. description. datacontractserializeroperationbehavior
Agreement: http://tempuri.org/:IRetriever ----> system. invalidoperationexception: The type "EC. datamodel. paging '1 [[EC. datamodel. productproperty, EC. datamodel, version = 4.0.0.0, culture = neutral, publickeytoken = NULL] "datacontract is added to datacontractset, because the existing data protocol name is also the namespace" Protocol, EC. datamodel, version = 4 . 0.0.0, culture = neutral, publickeytoken = NULL] ", and these protocols are not equivalent.
In system. runtime. serialization. datacontractset. Add (xmlqualifiedname, datacontract)

 

Solution:

 

Custom generic data protocol name

[datacontract (name = " drawing_using _ {1} _ brush_and _ {0} _ shape ")]
Public class drawing
{< br> // code not shown.
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.