Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error CS0234: The type or namespace name 'Script' does not exist in the namespace 'System.Web'

I am trying to use JavaScriptSerializer in my application.

I initially received

Cannot find JavaScriptSerializer

and I solved it by adding:

using System.Web.Script.Serialization;

But then the sub-keyword Script is underlined with a blue line:

The type or namespace 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

So I added to the project a reference to:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Extensions.dll

That didn't help. I am still receiving the same blue underline with same error. The reference is marked with an exclamation mark yellow warning:

enter image description here

I tried the suggested solutions on this thread, but as @user781490 indicated, they didn't help in my situation.

Any idea how to resolve this?

like image 743
scatmoi Avatar asked Oct 23 '12 16:10

scatmoi


People also ask

How do I fix error cs0234?

To fix this error, simply update the example . csproj file to use a previous System. CommandLine version. Note that this package is only used to parse the options for the example.

Where is System Web script serialization?

Serialization is in the System. Web. Extensions library.

How do you add references to System Web Extensions?

Right click on the References item in your Solution Explorer. Choose Add Reference... In the . NET tab, scroll down to System.


2 Answers

I had the same. Script been underlined. I added a reference to System.Web.Extensions. Thereafter the Script was no longer underlined. Hope this helps someone.

like image 175
Costa Zachariou Avatar answered Oct 22 '22 06:10

Costa Zachariou


Add System.Web.Extensions as a reference to your project

enter image description here

For Ref.

like image 33
Siddhartha Avatar answered Oct 22 '22 05:10

Siddhartha