How to fix the error type "System.Web.Script.Serialization.JavaScriptSerializer" is not defined

The super obvious way is to add a link to System.web

I have done it. This does not work.

+6
source share
2 answers

Add a link to System.Web.Extensions

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx

Namespace: System.Web.Script.Serialization

Build: System.Web.Extensions (in System.Web.Extensions.dll)

+21
source

How to add System.Web.Extensions in Visual Studio 2012:

  • Right click on your project.
  • Click Properties
  • Click the Links tab on the left.
  • Click the Add button
  • Click Assemblies
  • Click Frames
  • Scroll down and find "System.Web.Extensions" and check the box next to it, then click "OK" and save the "Properties" window.
  • Type Imports System.Web.Script.Serialization at the top of the file (or for C # using System.Web.Script.Serialization; )

I just needed to figure this out, and it took me a lot longer than I needed to find the answer, so maybe this will help someone.

+5
source

Source: https://habr.com/ru/post/956320/


All Articles