I am working on a Sitecore 9 solution which is hosted on Azure PaaS.

I have a simple piece of code that is meant to store an object in session which works fine on my local machine but once deployed to the Azure WebApp I get below exception:

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: mscorlib
  at System.Object.GetType()
  at Sitecore.SessionProvider.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs)
  at Sitecore.SessionProvider.Redis.RedisConnectionWrapper.TryUpdateAndReleaseLockIfLockIdMatch(String sessionId, Object lockId, ISessionStateItemCollection data, Int32 sessionTimeout)
  at Sitecore.SessionProvider.Redis.RedisSessionStateProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
  at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
  at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

enter image description here

Has someone faced a similar issue in past and has an idea what needs to be done to fix it?

Regards, Pratik Thakker

  • I haven't had a similar issue, but can you use the FTP for the Azure site and see if your code files you are expecting are all there? I have seen some things not get deployed and errors you would normally get locally look different in Azure. – RReilley Apr 12 '18 at 3:05
  • Thanks for the comment @RReilley. I did check the code files on the server and it seems to have all the expected files. – PratikT Apr 12 '18 at 5:11
  • The only thing that I can think of at the moment is to check if your object is serializable? Or try to set redis in config on your local machine and test. – Bartłomiej Mucha Apr 12 '18 at 8:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.