在类库中添加 System.Web.Script 引用
我目前正在将代码从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
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.
您需要在项目中添加对 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.我一直在测试 .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 referenceSystem.Web.Extensions