You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加System.Web.WebPages.dll至IIS SharePoint 80 Bin目录后触发空引用错误

SharePoint中使用AntiForgery.Validate()触发空引用错误问题
  • 为修复CSRF漏洞,我在按钮点击事件里添加了AntiForgery.Validate()方法
  • 该方法依赖System.Web.Helpers命名空间(对应System.Web.WebPages.dll程序集),我已添加该程序集引用
  • 发布部署至IIS后,System.Web.WebPages.dll已放入SharePoint 80站点的Bin目录
  • 但运行应用时,未出现预期的“Request Antiforgery token and its value”提示,反而触发**“Object reference not set to an instance of an object”空引用错误**

相关截图:

  • 运行门户时的错误截图
  • Bin目录中的dll截图

内容的提问来源于stack exchange,提问作者Shan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 08:52:03