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