在类库中添加 System.Web.Script 引用

发布于 2024-07-27 23:33:06 字数 252 浏览 2 评论 0原文

我目前正在将代码从 app_code 文件夹移动到类库。 我用 [System.Web.Script.Serialization.ScriptIgnore] 属性标记了几种方法。 我的类库看不到这个命名空间。 我的添加引用对话框看不到此命名空间。 如何正确使用类库中的此标签?

这是错误: 找不到类型或命名空间名称“ScriptIgnoreAttribute”(是否缺少 using 指令或程序集引用?)

I am currently moving code from my app_code folder to a class library. I have tagged several methods with [System.Web.Script.Serialization.ScriptIgnore] attributes. My class library cannot see this namespace. My add references dialog cannot see this namespace. How do I properly use this tag from a class library?

Here is the error:
The type or namespace name 'ScriptIgnoreAttribute' could not be found (are you missing a using directive or an assembly reference?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

薄荷→糖丶微凉 2024-08-03 23:33:06

ScriptIgnoreAttribute 类位于 System.Web.Extensions.dll 程序集中(位于 VS 引用管理器中的 Assemblies > Framework 下)。 您必须在类库项目中添加对该程序集的引用。

您可以在 ScriptIgnoreAttribute 类

The ScriptIgnoreAttribute class is in the System.Web.Extensions.dll assembly (Located under Assemblies > Framework in the VS Reference Manager). You have to add a reference to that assembly in your class library project.

You can find this information at top of the MSDN page for the ScriptIgnoreAttribute class.

凉月流沐 2024-08-03 23:33:06

您需要在项目中添加对 System.Web.Extensions.dll 的引用,以解决 System.Web.Script.Serialization 错误。

You need to add a reference to System.Web.Extensions.dll in project for System.Web.Script.Serialization error.

爱你是孤单的心事 2024-08-03 23:33:06

我一直在测试 .Net Framework V4.7,并从参考 System.Web.Extensions 中找到了 System.Web.Script 命名空间

输入图片此处描述

I have been testing for .Net Framework V4.7 and have found the System.Web.Script namespace from the reference System.Web.Extensions

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文