日期:2014-05-17  浏览次数:20456 次

一个我很纠结的问题,兄弟们来看卡
网站运行一段时间就会报错(大概1-2天),

Server Error in '/' Application.
--------------------------------------------

Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
谁知道怎么解决啊,我用了Cache是不是这个引起的呢

------解决方案--------------------
NullReferenceException,有空引用,访问了null对象,调试吧
------解决方案--------------------
代码考虑不全,没有想到对象为空时候,但仍然访问该对象的属性或者方法的情况,只能具体到产生错误 的文件.
------解决方案--------------------
在程序有有可能出现null对象的地方加一个try..catch或者加一次判断,然后向页面输出一个特定的信息。看看到底是哪里报错。你的cache也同样需要判断是否为null
------解决方案--------------------
空引用。调试, log ......
------解决方案--------------------
空指针异常
------解决方案--------------------
call stack是什么? 不行就用日志吧。

IIS进程会死掉? 看来问题比较严重啊。
------解决方案--------------------
程序逻辑上面的问题嘛,仔细检查一下哪里出问题了,调一下就行了
------解决方案--------------------
你在本地调一下,打开直接按倒F5,就知道哪里出错咯。其实你最好看看你的数据库访问类