Azure / aspnet-redis-providers

ASP.NET Redis Providers
Other
268 stars 180 forks source link

Web project not able to start after upgrade to v5 #196

Closed DarthSonic closed 1 year ago

DarthSonic commented 1 year ago

Original german message:

Source: mscorlib;

TargetSite: System.Type GetType();

Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

bei System.Object.GetType()
bei Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs)
bei Microsoft.Web.Redis.RedisConnectionWrapper.Set(ISessionStateItemCollection data, Int32 sessionTimeout)
bei Microsoft.Web.Redis.RedisSessionStateProvider.d__24.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.AspNet.SessionState.SessionStateModuleAsync.d__80.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask(IAsyncResult ar)
bei System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
bei System.Web.HttpApplication.<>c__DisplayClass285_0.b__0()
bei System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously))

Auto translated:

Source: mscorlib;

TargetSite: System.Type GetType();

The object reference was not set to an object instance.

for System.Object.GetType()
at Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs)
at Microsoft.Web.Redis.RedisConnectionWrapper.Set(ISessionStateItemCollection data, Int32 sessionTimeout)
at Microsoft.Web.Redis.RedisSessionStateProvider.d__24.MoveNext()
--- End of stack monitoring from previous location where exception was thrown ---.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.SessionState.SessionStateModuleAsync.d__80.MoveNext()
--- End of stack monitoring from previous location where exception was thrown ---.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.<>c__DisplayClass285_0.b__0()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously))
DarthSonic commented 1 year ago

Okay, I see it is a duplicate of https://github.com/Azure/aspnet-redis-providers/issues/190

But how can I tell which class is not set as serializable that causes this exception?

DarthSonic commented 1 year ago

This is what I get from my custom RedisLogger implementation:

[2023-06-16 12:35:53.710][Info]GetItem => Session Id: broutfmakom2xf22qttsvqsp, Session provider object: 12471998.
[2023-06-16 12:35:55.212][Info]GetItemFromSessionStore => Session Id: broutfmakom2xf22qttsvqsp, Session provider object: 12471998 => Lock taken with lockId: 
[2023-06-16 12:35:59.435][Info]CreateNewStoreData => Session provider object: 12471998.
[2023-06-16 12:36:04.101][Error]SetAndReleaseItemExclusive => System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
stanleysmall-microsoft commented 1 year ago

Okay, I see it is a duplicate of #190

But how can I tell which class is not set as serializable that causes this exception?

This was addressed in PR #193

I will leave this issue open until a new version is released