This blog Program During use, check the error log and find the following errors:
< Erroritem >
< Date > 18:07:26 error file: http://xianfen.net/Default.aspx </ Date >
< Message > Error message: an exception of the type "system. Web. httpunhandledexception" is thrown. Internal error message: the instance of the object has not been referenced. </ Message >
</ Erroritem >
< Erroritem >
< Date > 18:07:27 error file: http://xianfen.net/Default.aspx </ Date >
< Message > Error message: an exception of the type "system. Web. httpunhandledexception" is thrown. Internal error message: the instance of the object has not been referenced. </ Message >
</ Erroritem >
< Erroritem >
< Date > 21:01:47 error file: http://www.xianfen.net/Category5_1.aspx? Classid = 5 & Amp; Page = 1 </ Date >
< Message > Error message: an exception of the type "system. Web. httpunhandledexception" is thrown. Internal error message: the instance of the object has not been referenced. </ Message >
</ Erroritem >
< Erroritem >
< Date > 9:21:02 error file: http://www.xianfen.net/Archive200712.aspx? Year = 2007 & Amp; Month = 12 </ Date >
< Message > Error message: an exception of the type "system. Web. httpunhandledexception" is thrown. Internal error message: the instance of the object has not been referenced. </ Message >
</ Erroritem >
...
Many "instances where object references are not set to objects .", Review each row of programs carefully and no empty objects are found. In desperation, debug on the local machine and find exceptionsCodeSection:
Public Static String Blogtitle
{
Get
{
If (Httpcontext. Current. cache [ " Blogtitle " ] = Null )
{
Httpcontext. Current. cache [ " Blogtitle " ] = Configurationmanager. deleettings [ " Blogtitle " ];
}
ReturnHttpcontext. Current. cache ["Blogtitle"]. Tostring ();//An exception is thrown here. "The object reference is not set to the object instance"
}
}
To improve performance, this blog system uses multiple caches, but does it check whether it is empty every time cache data is retrieved? I had to go to Google and found that I encountered the same problem. The original cache will be removed when the memory is insufficient. It seems that the memory of the virtual space is very tight, and the cache I just set is removed!
Replace the cache with application:
Public Static String Blogtitle
{
Get
{
If (Httpcontext. Current. application [ " Blogtitle " ] = Null )
{
Httpcontext. Current. application [ " Blogtitle " ] = Configurationmanager. deleettings [ " Blogtitle " ];
}< P>
return httpcontext. current. application [ " blogtitle " ]. tostring ();
}< BR >}< br>
solution!