I cannot seem to find the JavaScriptSerializer
object nor the the System.Web.Script.Serialization
namespace within Visual Studio 2010. I need to serialize something to JSON what am I supposed to use?
And yes, I already included the System.Web.Extensions
(in System.Web.Extensions.dll) within the project. Which is why I am shocked?
System.Web.Extensions
was marked as obsolete in 3.5Text. Json namespace should be used for serialization and deserialization.
JavaScriptSerializer is a class that helps to serialize and deserialize JSON. It is present in the namespace System.
Serialization is in the System. Web. Extensions library. Make sure you are using .
Check if you included the .net 4 version of System.Web.Extensions
- there's a 3.5 version as well, but I don't think that one works.
These steps work for me:
System.Web.Extensions
(4.0)JavaScriptSerializer
in Program.cs now :-)References
and do Add Reference
, then from Assemblies->Framework
select System.Web.Extensions
. using System.Web.Script.Serialization;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With