Cannot import `Imports System.Web.Script.Serialization`
import, namespaces, vb.net, visual-studio-2010
Solution
You might be missing an assembly reference to `System.Web.Extensions.dll`. Add this reference to your project, then try again.
Generally speaking, when you encounter this issue, go to the .NET API reference page of the type you want to use — for instance, `JavaScriptConverter` — and look out for the Namespace and Assembly hints (make sure you're looking at the page for the .NET framework version that you are using):
- Namespace: tells you what to put in the `Imports` directive.
- Assembly: tells you what assembly you need to reference in your project (e.g. go to Solution Explorer, locate References, and select Add Reference… from the context menu).
Problem
When I try to `Imports System.Web.Script.Serialization`, I get an error in VB 2010 that says: Warning: Namespace or type specified in the Imports `System.Web.Script.Serialization` 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. Not sure why I can't import it.