When you use the Microsoft SQL Server Session state, and you turn on the OutPutCaching feature for a Web page, if you set the Location attribute to Client (<%@ OutputCache Location="Client" Duration="900" VaryByParam="WaitMessage" %>), a user may receive the following error message when the user accesses the Web page more than one time:
NullReferenceException: "Object reference not set to an instance of an object"
When this problem occurs, a stack trace that is similar to the following appears in the client window:
Stack Trace ======================= Server Error in '/PlacingFileComplete' 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. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] System.Web.SessionState.SqlStateClientManager.CanUsePooling() +33 System.Web.SessionState.SqlStateClientManager.GetConnection(Boolean& usePooling) +11 System.Web.SessionState.SqlStateClientManager.ResetTimeoutAsyncWorker(String id) +40 System.Web.SessionState.SqlStateClientManager.ResetTimeout(String id) +4 System.Web.SessionState.SessionStateModule.OnEndRequest(Object source, EventArgs eventArgs) +102 System.Web.SyncEventExecutionStep.Execute() +60
The first time that a user accesses the Web page, Microsoft ASP.NET caches a copy of the Web page by using the user's unique session ID. The ASP.NET worker process uses this cached copy of the Web page for all later page rendering. After 900 seconds, the cache expires. Then the cached copy of the Web page is deleted from memory. However, the user's session ID is still active.
When the user tries to access the Web page again, the user receives the error message that appears in the "Symptoms" section because the cached copy of the Web page has been deleted.
Software update information
A supported software update is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This software update may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Microsoft .NET Framework 1.0 service pack that contains this software update.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the software update. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
You must have the .NET Framework 1.0 Service Pack 2 installed to install this hotfix.
You may have to restart your computer after you apply this software update if any services or applications that use files that appear in the "File information" section of this article are running when you apply this software update.
This software update does not replace any other software updates.
The English version of this software update has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Microsoft .NET Framework 1.0, Microsoft Visual Studio .NET 2002 Professional Edition, Microsoft Visual Studio .NET 2002 Enterprise Architect, Microsoft Visual Studio .NET 2002 Enterprise Developer, Microsoft ASP.NET 1.0