Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: ASP.NET returns a "NullReferenceException" error message when you use SQL Server Session state and you turn on the OutPutCaching feature


View products that this article applies to.

Symptoms

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

↑ Back to the top


Cause

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.

↑ Back to the top


Resolution

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.

Prerequisites

You must have the .NET Framework 1.0 Service Pack 2 installed to install this hotfix.

Restart requirement

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.

Restart requirement

This software update does not replace any other software updates.

File information

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.
   Date         Time   Version       Size       File name
   ---------------------------------------------------------------------------------------------
   09-Nov-2003  01:45  1.0.3705.468    200,704  Aspnet_isapi.dll
   09-Nov-2003  01:38                    4,169  Aspnet_perf.h
   09-Nov-2003  01:45                  513,302  Aspnet_perf.ini
   09-Nov-2003  01:45                  510,714  Aspnet_perf2.ini
   09-Nov-2003  01:45  1.0.3705.468     24,576  Aspnet_regiis.exe
   09-Nov-2003  01:45  1.0.3705.468     28,672  Aspnet_wp.exe
   09-Nov-2003  00:59  1.0.3705.468     69,632  Corperfmonext.dll
   17-Jun-2003  21:43                   16,597  Installpersistsqlstate.sql
   17-Jun-2003  21:43                   17,331  Installsqlstate.sql
   09-Sep-2003  00:28                   17,807  Installsqlstatetemplate.sql
   09-Nov-2003  00:58  1.0.3705.468    303,104  Mscorjit.dll
   10-Nov-2003  18:11  1.0.3705.468  1,953,792  Mscorlib.dll
   09-Nov-2003  00:51                   10,284  Mscorlib.ldo
   09-Nov-2003  00:58  1.0.3705.468  2,273,280  Mscorsvr.dll
   09-Nov-2003  00:59  1.0.3705.468  2,269,184  Mscorwks.dll
   09-Nov-2003  01:42  1.0.3705.468     20,480  Perfcounter.dll
   23-Aug-2002  02:23                       15  Smartnav.htm
   30-Jul-2003  00:04                    8,728  Smartnav.js
   10-Nov-2003  17:53  1.0.3705.468  1,179,648  System.data.dll
   10-Nov-2003  18:10  1.0.3705.468  1,695,744  System.design.dll
   10-Nov-2003  17:53  1.0.3705.468  1,175,552  System.dll
   10-Nov-2003  17:51  1.0.3705.468    241,664  System.messaging.dll
   10-Nov-2003  17:51  1.0.3705.468    311,296  System.runtime.remoting.dll
   10-Nov-2003  17:49  1.0.3705.468    131,072  System.runtime.serialization.formatters.soap.dll
   10-Nov-2003  17:55  1.0.3705.468  1,196,032  System.web.dll
   10-Nov-2003  17:51  1.0.3705.468    507,904  System.web.services.dll
   10-Nov-2003  18:12  1.0.3705.468  1,994,752  System.windows.forms.dll
   09-Nov-2003  01:51                   16,776  System.windows.forms.ldo
   09-Nov-2003  01:47  1.0.3705.468     57,344  System.windows.forms.tlb
   10-Nov-2003  18:08  1.0.3705.468  1,302,528  System.xml.dll
   10-Nov-2003  17:47  1.0.3705.468     32,768  Tlbimp.exe
   17-Jun-2003  21:43                    1,419  Uninstallpersistsqlstate.sql
   09-Sep-2003  00:28                    2,119  Uninstallsqlstatetemplate.sql
   10-Nov-2003  17:48  1.0.3705.468     65,536  Wsdl.exe

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

By default, the OutputCache directive is set to Server. To reproduce the problem, set the OutputCache directive to Client, as in the following example:
<%@ OutputCache Location="Client" Duration="900" VaryByParam="WaitMessage" %>
For more information about the terminology that is used to describe Microsoft product updates, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

↑ Back to the top


References

For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
317604 How to configure SQL Server to store ASP.NET Session State
315896 How to improve performance by caching pages in ASP.NET

↑ Back to the top


Keywords: kbqfe, kbvs2002sp1sweep, kbfix, kbqfe, kbnetframe100presp3fix, kbsqlserv2000sp1fix, kbbug, kbhotfixserver, KB831382

↑ Back to the top

Article Info
Article ID : 831382
Revision : 6
Created on : 10/25/2005
Published on : 10/25/2005
Exists online : False
Views : 482