This project is read-only.
4
Vote

Windows Phone - "Session state service failed"

description

Posted in Discussions: Windows Phone - "Session state service failed"

P.S. Didn't want to duplicate the posting so I just link it, if that's ok.

Thanks!...

Edit: Link is working, first time posting an issue.

comments

VcDeveloper wrote Oct 10, 2014 at 7:58 PM

The Link is not working, so I'll just post it...
-       e   {Windows.UI.Xaml.UnhandledExceptionEventArgs}   Windows.UI.Xaml.UnhandledExceptionEventArgs
-       Exception   {Microsoft.Practices.Prism.Mvvm.SessionStateServiceException: Session state service failed ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at Windows.UI.Xaml.Controls.Frame.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.FrameFacadeAdapter.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.SaveFrameNavigationState(IFrameFacade frame)
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.Practices.Prism.Mvvm.MvvmAppBase.<OnSuspending>d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()}    System.Exception {Microsoft.Practices.Prism.Mvvm.SessionStateServiceException}
+       [Microsoft.Practices.Prism.Mvvm.SessionStateServiceException]   {Microsoft.Practices.Prism.Mvvm.SessionStateServiceException: Session state service failed ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at Windows.UI.Xaml.Controls.Frame.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.FrameFacadeAdapter.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.SaveFrameNavigationState(IFrameFacade frame)
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.Practices.Prism.Mvvm.MvvmAppBase.<OnSuspending>d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()}    Microsoft.Practices.Prism.Mvvm.SessionStateServiceException
+       Data    {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
        HelpLink    null    string
        HResult -2146233088 int
-       InnerException  {System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at Windows.UI.Xaml.Controls.Frame.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.FrameFacadeAdapter.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.SaveFrameNavigationState(IFrameFacade frame)
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()}    System.Exception {System.ArgumentNullException}
+       [System.ArgumentNullException]  {System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at Windows.UI.Xaml.Controls.Frame.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.FrameFacadeAdapter.GetNavigationState()
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.SaveFrameNavigationState(IFrameFacade frame)
   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()}    System.ArgumentNullException
+       Data    {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
        HelpLink    null    string
        HResult -2147467261 int
+       InnerException  null    System.Exception
        Message "Value cannot be null.\r\nParameter name: key"  string
        Source  "mscorlib"  string
        StackTrace  "   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)\r\n   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)\r\n   at Windows.UI.Xaml.Controls.Frame.GetNavigationState()\r\n   at Microsoft.Practices.Prism.Mvvm.FrameFacadeAdapter.GetNavigationState()\r\n   at Microsoft.Practices.Prism.Mvvm.SessionStateService.SaveFrameNavigationState(IFrameFacade frame)\r\n   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()" string
+       Static members      
+       Non-Public members      
        Message "Session state service failed"  string
        Source  "Microsoft.Practices.Prism.StoreApps"   string
        StackTrace  "   at Microsoft.Practices.Prism.Mvvm.SessionStateService.<SaveAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n   at Microsoft.Practices.Prism.Mvvm.MvvmAppBase.<OnSuspending>d__d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)\r\n   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()"   string
+       Static members      
+       Non-Public members      
        Handled false   bool
        Message "Session state service failed"  string

kingnaoufal wrote Oct 26, 2014 at 8:09 PM

Same issue when i'm going deep in navigation like First page that contains a pivot with a list view, after clicking to an item to see detail i'm navigate to the detail page.

After simulating the suspending from this point and resuming the library crash and the message is
    Message "Session state service failed"  string.
I think that the SessionStateService.SaveAsync fail in some point from the internal dictionnary.

Best regards

ethan2012 wrote Jun 8, 2015 at 9:13 PM

I have the same issue for both windows 8.1 and windows phone 8.1
When I navigate to the third page and minimize the app, it crashes with Session state service failed and traced it down to this code in the MvvmAppBase class - it crashed on await SessionStateService.SaveAsync();
private async void OnSuspending(object sender, SuspendingEventArgs e)
        {
            IsSuspending = true;
            try
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                //Bootstrap inform navigation service that app is suspending.
                NavigationService.Suspending();

                
                // Save application state
                await SessionStateService.SaveAsync();
                

                deferral.Complete();
            }
            finally
            {
                IsSuspending = false;
            }
        }
The suspending and resuming does not work properly I think. I also tested the adventureshopper app and after navigating deep in the app and minimized it..it crashed also with same problem.