uwp页面访问initializecomponent上的voilation异常

时间:2018-05-09 10:15:11

标签: c# xaml uwp windows-store

所以我在商店里有一个 uwp app 。这一切都运行良好,然后我做了一些更改,以进行更新。仍然它运行正常,然后我上传更新的包到商店和商店认证失败,并根据报告。当我的某个页面被导航到应用程序崩溃时。

我一直在尝试,但我无法在我的机器上重现问题,然后今天我只是卸载了应用程序,清理了项目并再次运行应用程序,我看到当我尝试导航到那时我得到了一个异常。

AccesVoilation,试图读取或写入内存,这意味着内存可能已损坏。

现在我无法找到原因,我不知道这里要显示的代码,因为甚至没有异常的堆栈跟踪。当我点击异常细节时,调试会自动停止。

CODE 这是我的页面构造函数的代码

public ShellPage()
    {
        InitializeComponent();
        DataContext = ViewModel;
        if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5))
        {
            NavigationMenu.Visibility = Visibility.Collapsed;
            ViewModel.Initialize(newShellFrame);
        }
        else
        {
            ViewModel.Initialize(shellFrame);// for creators update
        }
    }

更新一种奇怪的行为,有时我会遇到此异常,有时我不会:/

更新2

栈跟踪

在Windows.UI.Xaml.Application.LoadComponent(对象组件,Uri resourceLocator,ComponentResourceLocation componentResourceLocation)\ r \ n在FluentVideoPlayer.View.ShellPage.InitializeComponent()\ r \ n在FluentVideoPlayer.Views.ShellPage..ctor ()\ r \ n在FluentVideoPlayer.FluentVideoPlayer_XamlTypeInfo.XamlTypeInfoProvider.Activate_89_ShellPage()\ r \ n在FluentVideoPlayer.FluentVideoPlayer_XamlTypeInfo.XamlUserType.ActivateInstance()"串

0 个答案:

没有答案