我尝试使用MvvmCross创建具有最新UWP位(RTM)的Windows通用应用程序。在App.xaml.cs,当我尝试运行 -启动MvvmCross Uwp应用程序时出现异常:“System.AccessViolationException:试图读取或写入受保护的内存”
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仓库吗?这会让你更容易看。 – Martijn00
好吧,我在这里添加它:https://github.com/ehuna/MvvmCross.Test.Uwp – ehuna
嘿@ehuna说实话我已经尝试改变你的github回购,但也无法启动和运行。所以也许我们可以倒退?我在我的github上添加了一个可用的UWP版本https://github.com/Depechie/MvvmCrossUWPSplitView,或许你可以把它当作你的基地? – Depechie