The strange problem of system. runtime. serialization. JSON cannot be found.

Source: Internet
Author: User

I encountered a very simple but strange problem during development yesterday.

 
If(Filtercontext. httpcontext. Request. contenttype ??String. Empty). Contains ("Application/JSON")){ObjectO =NewDatacontractjsonserializer (roottype). readobject (filtercontext. httpcontext. Request. inputstream); filtercontext. actionparameters [Param]=O ;}

 

Datacontractjsonserializer cannot find the corresponding link library, and added system. runtime. serialization cannot be solved.

The solution is as follows:

1. I think that I do not have a. Net 3.0 version. After checking the version, I find that it exists. Then I think it may not be the latest version. So I downloaded the update online, and the result is still unsolved.

2. Google it and find the answer:

You need to add a reference to the system. servicemodel assembly as well.

Using system. runtime. serialization;
Using system. servicemodel;

System. runtime. serialization. dll (download)
System. servicemodel. dll
System. servicemodel. Web. dll

Hope this helps!

Very stranger but very happy

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.