Losing Session State on postback event




Hi,

I've got a problem with losing session state in ASP.NET version 2.

It does it intermittently - sometimes it tanks - and sometimes it works OK.

I've got the ASP.NET state service started - the separate process for state management:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
StateServer mode stores session state in a process, referred to as the ASP.NET
state service, that is separate from the ASP.NET worker process or IIS application
pool. Using this mode ensures that session state is preserved if the Web application
is restarted and also makes session state available to multiple Web servers in a
Web farm.

To use StateServer mode, you must first be sure the ASP.NET state service is running
on the server used for the session store. The ASP.NET state service is installed as
a service when ASP.NET and the .NET Framework are installed. The ASP.Net state
service is installed at the following location:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



... and I've made the proper entries in Web.config:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<sessionState mode="StateServer"
stateConnectionString="tcpip=localhost:42424"
cookieless="false"
timeout="20"/>

</system.web>
</configuration>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



I've set ASP.NET State Service startup type to "Automatic" in system services
- and I see that status is listed there as "started"
- and I see the active process listed in WinTasks as well.


Does anyone have any idea as to what is causing this?

Is there any way to get more information on this?

THANKS IN ADVANCE!



This is the error page:
##################################################################################
##################################################################################

Server Error in '/Webfolder01' 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:


Line 1382: (ArrayList DC_ndx_array)
Line 1383: {
Line 1384: int lcl_DC_ndx, maxc = DC_ndx_array.Count;
Line 1385: string sav_ctrl_ID, next_ctrl_ID;
Line 1386: ArrayList next_DC_ndx_array;


Source File: i:\Virtual Webfolders\CtrlInit\CtrlRay.cs Line: 1384

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Ctrl_Array.dynamic_control_array_creation.generate_dynamic_control_structure
(ArrayList DC_ndx_array) in i:\Virtual Webfolders\CtrlInit\CtrlRay.cs:1384
dynamic_control_creation.load_dynamic_ctrl_struct02(Object sender, EventArgs e)
in i:\Virtual Webfolders\CtrlInit\dynctrl.cs:175
ASP.ctrlinit_ctrlinit12b_aspx.Page_Init(Object sender, EventArgs e)
in i:\Virtual Webfolders\CtrlInit\CtrlInit12b.aspx:37
System.Web.Util.CalliHelper.EventArgFunctionCaller
(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback
(Object sender, EventArgs e) +34
System.Web.UI.Control.OnInit(EventArgs e) +2069692
System.Web.UI.Page.OnInit(EventArgs e) +9
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +692


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
##################################################################################
##################################################################################



NOTE: DC_ndx_array gets assigned an ArrayList from a key/value pair in session state.


..
.



Relevant Pages

  • Re: Is there a "State Server"
    ... difference have you found between using the state service on another machine ... > this ais a mode where we store sessions on a dedicated server. ... >> you need to maintain session state in a web server farm. ...
    (microsoft.public.dotnet.framework.aspnet)
  • ASP.NET State Service
    ... I'm trying to store session state in a Windows Service. ... I start the ASP.NET State Service and modify the ... the client and server ports are the same. ... how do I set the client port? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Session state doesnt work
    ... stated in both responses), ... Juan T. Llibre, asp.net MVP ... when I use Server.Execute instead of Server.Transfer the session state ... Object reference not set to an instance of an object. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session state doesnt work
    ... of Server.Transfer the session state is maintained. ... stated in both responses), ... Juan T. Llibre, asp.net MVP ... Object reference not set to an instance of an object. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session state doesnt work
    ... stated in both responses), ... I have read the responses from Juan and Karl (thanks also for your ... when I use Server.Execute instead of Server.Transfer the session state ... Object reference not set to an instance of an object. ...
    (microsoft.public.dotnet.framework.aspnet)