【发布时间】:2016-01-08 22:49:13
【问题描述】:
我正在尝试使用 MvvmCross 创建一个具有最新 UWP 位 (RTM) 的 Windows 通用应用程序。在 App.xaml.cs 中,当我尝试运行时 -
var start = Mvx.Resolve<IMvxAppStart>();
start.Start();
我收到“System.AccessViolationException”-
Message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
我创建了一个示例项目来重现该问题,它包含 -
- 面向“.NET Framework 4.6”和“Windows 10”的可移植类库 (Test.NewCore)。
- “通用 Windows”应用 (Test.Uwp),针对“Windows 10 (10.0; Build 10240)”
- 我正在使用最新的 nuget 预发布包“MvvmCross 4.0.0-beta3”,我相信我已正确设置(我查看了此处的示例:https://github.com/MvvmCross/MvvmCross/tree/4.0/nuspec
你可以在这里下载测试项目:http://1drv.ms/1G6w2m3
完整的堆栈跟踪如下 -
System.AccessViolationException was unhandled
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=Windows
StackTrace:
at Windows.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter)
at Cirrious.MvvmCross.WindowsUWP.Views.MvxWindowsViewPresenter.Show(MvxViewModelRequest request)
at Cirrious.MvvmCross.WindowsUWP.Views.MvxWindowsMainThreadDispatcher.RequestMainThreadAction(Action action)
at Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModel[TViewModel](IMvxBundle parameterBundle, IMvxBundle presentationBundle, MvxRequestedBy requestedBy)
at Cirrious.MvvmCross.ViewModels.MvxAppStart`1.Start(Object hint)
at Test.Uwp.App.OnLaunched(LaunchActivatedEventArgs e)
InnerException:
我使用的是 Windows 10 RTM 和 Visual Studio 2015 RTM,没有 beta 位(MvvmCross 除外)。
我做错了什么?
我非常喜欢 MvvmCross,并且我开始将现有的 Windows 8.1 / Windows Phone 8.1 解决方案移植到 Uwp - 只是对在 Uwp 中使用最新的 MvvmCross 位进行一些探索性研究。
感谢您的帮助! @ehuna
【问题讨论】:
-
你能把测试项目放在 Github repo 中吗?这样更容易查看。
-
好的,我在这里添加了它:github.com/ehuna/MvvmCross.Test.Uwp
-
嘿@ehuna 老实说我已经尝试更改您的 github 存储库,但也无法启动并运行它。所以也许我们可以向后工作?我在我的 github github.com/Depechie/MvvmCrossUWPSplitView 上添加了一个可用的 UWP 版本,也许你可以把它作为你的基础?