14

The super obvious way is to add reference to System.web

I did that. It doesn't work.

1
  • Related post here. Commented Nov 12, 2017 at 1:17

2 Answers 2

31

Add a reference to System.Web.Extensions

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

Namespace: System.Web.Script.Serialization

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

Sign up to request clarification or add additional context in comments.

2 Comments

Ah so that's how to find out how to know the dll to include.
How to "add a reference" for complete newbies, like me: msdn.microsoft.com/en-us/library/wkze6zky.aspx
12

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

  • Right-click your project.
  • Click "Properties"
  • Click the "References" tab on the left.
  • Click the "Add" button
  • Click "Assemblies"
  • Click "Framework"
  • 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 your file (or, for C# using System.Web.Script.Serialization;)

I just had to figure this out, and it took me way longer than it should have to find the answer, so maybe that will help someone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.