报警提示 System.NullReferenceException:“未将对象引用设置到对象的实例。

System.NullReferenceException:“未将对象引用设置到对象的实例。是就因为Session在记录到服务器时,没有添加  IRequiresSessionState 所以运行时回报警,

解决错误就是在最上方的头部添加IRequiresSessionState,并在引用using System.Web.SessionState;即可。

猜你喜欢

转载自www.cnblogs.com/yutang-wangweisong/p/11787758.html