Note the pitfalls of the higher version of. Net in the WCF Development notes, and the wcf development. net

Source: Internet
Author: User

Note the pitfalls of the higher version of. Net in the WCF Development notes, and the wcf development. net
Development Environment of higher version. Net

. Net 4.5.1
Visual Studio 2015RC
Windows 8.1
Web SQL Server 2005 sp1

Running Environment

. Net 4.0 en
Windows Server 2003
Web SQL Server 2005 sp1

Symptom

 

The development environment test is normal on the WCF client. After publishing to the running environment, the System prompts "Type 'System. threading. tasks. task '1 [XMRBI. ERoad. contracts. serviceResponse] 'cannot be serialized. consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. if the type is a collection, consider marking it with the CollectionDataContractAttribute. see the Microsoft. NET Framework documentation for other supported types.

Cause

By default, Visual Studio 2012 and later versions of svcutil generate the call method of XXXAsync. SimilarSystem. Threading. Tasks. Task <T>. However, in the runtime environment,. Net4.0 does not supportTask <T>.

Solution
  • Manually delete the XXXAsync method of the generated result



  • From Weizhi note (Wiz)



    Related Article

    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.