我嘗試使用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