[Mono-dev] SessionStateStoreProviderBase problem

René E. Kalverboer r_e_kalverboer at hotmail.com
Fri Mar 4 09:51:17 EST 2011


Hello,

I am running against a problem while creating a custom session store, i can't understand what is happening .
 Maybe someone can help me.

in
 short: Mono behaves different as .NET with this example. This code, a 
bare implementation of a SessionStateStoreProviderBase  just to point 
the problem. 

Has anybody a solution to pass this error? Is this a bug?

------------------------------------------------------------------------------------------------------------------------------

public sealed class RedisSessionStateStore : SessionStateStoreProviderBase {
    public override bool SetItemExpireCallback (SessionStateItemExpireCallback expireCallback){    return false;}
    public override void InitializeRequest (HttpContext context){}
    public override void EndRequest (HttpContext context){    }
   
 public override SessionStateStoreData GetItem(HttpContext context, 
string id, out bool locked, out TimeSpan lockAge, out object lockId, out
 SessionStateActions actionFlags){throw new 
System.NotImplementedException();}
            
    public 
override SessionStateStoreData GetItemExclusive(HttpContext context, 
string id, out bool locked, out TimeSpan lockAge, out object lockId, out
 SessionStateActions actionFlags){
        locked = false;
        lockAge = TimeSpan.Zero;
        lockId = 1;
        actionFlags = 0;
   
     return new SessionStateStoreData(new SessionStateItemCollection(), 
SessionStateUtility.GetSessionStaticObjects(context), 1200);     
    }
            
   
 public override void ReleaseItemExclusive (HttpContext context, string 
id, object lockId){throw new System.NotImplementedException();}
    
public override void SetAndReleaseItemExclusive (HttpContext context, 
string id, SessionStateStoreData item, object lockId, bool 
newItem){throw new System.NotImplementedException();}
    public 
override void RemoveItem (HttpContext context, string id, object lockId,
 SessionStateStoreData item){throw new 
System.NotImplementedException();}
    public override void ResetItemTimeout (HttpContext context, string id){    throw new System.NotImplementedException();}
   
 public override SessionStateStoreData CreateNewStoreData (HttpContext 
context, int timeout){    throw new System.NotImplementedException();}
   
 public override void CreateUninitializedItem (HttpContext context, 
string id, int timeout){    throw new 
System.NotImplementedException();}    
    public override void Dispose ()    {throw new System.NotImplementedException();}

}
------------------------------------------------------------------------------------------------------------------------------

In MONO runtime you get the error :

------------------------------------------------------------------------------------------------------------------------------
Argument cannot be null.
Parameter name: id
Description: HTTP 500. Error processing request.
Stack Trace: System.ArgumentNullException: Argument cannot be null.
Parameter name: id

 
 at System.Web.SessionState.HttpSessionStateContainer..ctor 
(System.String id, ISessionStateItemCollection sessionItems, 
System.Web.HttpStaticObjectsCollection staticObjects, Int32 timeout, 
Boolean newSession, HttpCookieMode cookieMode, SessionStateMode mode, 
Boolean isReadonly) [0x0005f] in 
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.Web\System.Web.SessionState_2.0\HttpSessionStateContainer.cs:78
 
...
Version information: Mono Runtime Version: 2.10.1 (tarball); ASP.NET Version: 2.0.50727.1433

------------------------------------------------------------------------------------------------------------------------------

In .NET runtime you get the error :

------------------------------------------------------------------------------------------------------------------------------

Server Error in '/' Application.
The method or operation is not implemented.
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.NotImplementedException: The method or operation is not implemented.

Source Error:
Line
 33:     public override void RemoveItem (HttpContext context, string 
id, object lockId, SessionStateStoreData item){throw new 
System.NotImplementedException();}
Line 34:     public override void 
ResetItemTimeout (HttpContext context, string id){    throw new 
System.NotImplementedException();}
Line 35:     public override 
SessionStateStoreData CreateNewStoreData (HttpContext context, int 
timeout){    throw new System.NotImplementedException();}
Line 36: 
    public override void CreateUninitializedItem (HttpContext context, 
string id, int timeout){    throw new 
System.NotImplementedException();}    
Line 37:     public override void Dispose ()    {throw new System.NotImplementedException();}

------------------------------------------------------------------------------------------------------------------------------


I hope somebody can help/explain me.

Greetings René 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110304/cdf07570/attachment.html 


More information about the Mono-devel-list mailing list