Json with .NET and C #?

I am having trouble parsing a Json string for objects in C #. I use this:

JavaScriptSerilizer parser = new JavaScriptSerializer();

but it does not recognize the JavaScriptSerilizer, and I cannot add this:

using System.Web.Script.Serialization;

but it returns an error without recognizing "Script" in "System.Web", and I added "System.Web" in the links. Also, I found "System.Web.Extensions.dll" in "C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0 \", added it as a link, but I get this error:

Could not resolve assembly "System.Web.Extensions". The assembly is not in the currently targetet framework...

I searched for the same file in the lower version but could not find it.

What am I doing wrong?

+3
source share
3 answers

This type is implemented in System.Web.Extensions.dll, not in System.Web.dll.

+4
source

System.Web.Extensions .

MSDN: JavaScriptSerializer

MSDN , , .

0

In the project, add a link to System.Web.Extensions (in System.Web.Extensions.dll).

0
source

All Articles