visual-studio - 即使删除 SessionState 代码,如何摆脱重复出现的 SessionState 错误“NullReferenceException”?
问题描述
我在 Visual Studio 2019 的 asmx Web 服务项目中对 SessionState 进行了试验。认为不值得麻烦,因此删除了我对用于测试的本地 IIS Web 服务器 web.config 所做的所有配置,并禁用了 ASP.NET services.msc 中的状态服务。但是现在,每当我在此 Visual Studio 项目中调试任何 Web 服务时,我都会在“Watch 1”选项卡中看到一个错误:
new System.Linq.SystemCore_EnumerableDebugView(Session.Contents.Keys).Items[0] 'new System.Linq.SystemCore_EnumerableDebugView(Session.Contents.Keys).Items[0]' threw an exception of type 'System.NullReferenceException' object {System.NullReferenceException}
代码没有中断,但我似乎无法阻止这个反复出现的 SessionState 错误的出现。将不胜感激任何帮助,谢谢
解决方案
推荐阅读
- node.js - Volta 和全局 npm 包
- laravel - 如何修改 API 以便用户也可以使用电子邮件和注册字段登录?
- pandas - 如何为图形添加图例
- python - 如何将数据框的值添加到另一个数据框?
- c++ - C++ 在内存中搜索匹配模式的二进制序列
- java - 使用存储过程相对于 Hibernate 的优势
- javascript - Angular/Ionic Singleton 在刷新后被销毁
- azure - Azure API 管理:无法使用 formdata 定义 POST API
- python - 将自定义函数应用于熊猫中的一列列表,如何处理异常?
- algorithm - 以下两种二分查找实现的性能差异