无法导入`导入System.Web.Script.Serialization`

编程入门 行业动态 更新时间:2024-10-21 19:07:47
本文介绍了无法导入`导入System.Web.Script.Serialization`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试Imports System.Web.Script.Serialization时,我在VB 2010中收到一条错误消息:

When I try to Imports System.Web.Script.Serialization, I get an error in VB 2010 that says:

警告:导入System.Web.Script.Serialization"中指定的命名空间或类型不包含任何公共成员,或者找不到.确保定义了名称空间或类型,并且至少包含一个公共成员.确保导入的元素名称不使用任何别名.

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.

推荐答案

您可能缺少对System.Web.Extensions.dll的程序集引用.将此引用添加到您的项目中,然后重试.

You might be missing an assembly reference to System.Web.Extensions.dll. Add this reference to your project, then try again.

通常来说,遇到此问题时,请转到您要使用的类型的.NET API参考页.例如 JavaScriptConverter —并查找命名空间"和程序集"提示(确保您正在查看正在使用的.NET Framework版本的页面):

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):

  • 命名空间:告诉您要在Imports指令中添加什么.
  • 程序集::告诉您在项目中需要引用的程序集(例如,转到 Solution Explorer ,找到 References ,然后选择从上下文菜单中添加引用….
  • 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).

更多推荐

无法导入`导入System.Web.Script.Serialization`

本文发布于:2023-11-10 02:24:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574085.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Web   System   Serialization   Script

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!