Grigory
Grigory

Reputation: 1922

Some magic STOWED EXCEPTION in Store dashboard

I have a UWP app in Windows Store.

Normally i see ~50 crashes in HockeyApp, and ~500 crashes in Windows Store health dashboard.

STOWED_EXCEPTION_System.ArgumentException_80070057
Frame   Image   Function    Offset
0   SharedLibrary   System::Delegate.InitializeClosedInstance   0x26
1   SharedLibrary   System::Action.ConstructClosedInstanceDelegate  0x20
2   XXX.dll XXX::Platform::Uwp::Xaml::XamlApp.OnInitialize 0x301

My code is very simple

public class XamlApp : Application 
{
    private Page _page;
    protected virtual void OnInitialize(ActivationKind activationKind, ApplicationExecutionState previouState)
    {
        if (_page == null) 
        {
            _page = _pageCreator();
            _page.Loaded += PageOnLoaded;
            Current.Suspending += Current_Suspending;
            Window.Current.CoreWindow.VisibilityChanged += CurrentOnVisibilityChanged;
            Window.Current.Content = _page;
        }
        else
        {
            Game.Marshal(Game.Resume);
        }
    }
    // ....
}

According to the implementation here i understand that reference to object is null. The question is - how can it be ? Looks like a bug in GC or somewhere in runtime.

Any ideas ?

Upvotes: 0

Views: 386

Answers (1)

Grigory
Grigory

Reputation: 1922

I'm so embarrassed. 10 minutes of writing question help more than 2 hours of thinking before that.

It is a normal exception that means that i tried to create a delegate that points to a method of a null object.

In my last line of code when arguments are computed and delegate is created from method group, before method invocation, this exception occurs.

Hope this will save someone few minutes of time

Upvotes: 2

Related Questions