RieqyNS13
RieqyNS13

Reputation: 495

cannot Imports System.Web.Script.Serializer

when I try to append this line to the code:

Imports System.Web.Script.Serializer

it showing me error like this:

Namespace or type specified in the Imports 'System.Web.Script.Serializer' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

then I searching references in google, say that should Add References then choose System.Net.Extension.dll in .NET tab, but it not found in the list

enter image description here

I try to import the System.Net.Extension.dll with manually. I open Add Reference dialog, in Browse tab, I select System.Web.Extension.dll in C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0, then klik Ok. but it still doesn't work instead show me error message agains like this:

enter image description here

enter image description here

whats wrong with my VS2010 ??

Upvotes: 0

Views: 697

Answers (1)

Jeff Mercado
Jeff Mercado

Reputation: 134571

That assembly requires the .NET 4.0 (full profile). Your project is currently targeting .NET 4.0 client profile. This is the typical default for most projects in 2010. Change the target framework to just the plain old vanilla .NET 4.0 and it should work.

For a VB.net project, you can do this by opening the project properties and going to the Compile tab then the Advanced Compile Settings. From there, change the Target framework (all configurations) to .NET Framework 4.

enter image description here

Upvotes: 1

Related Questions