- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 MvvmCross 创建一个 Windows 通用应用程序,其中包含最新的 UWP 位 (RTM)。在 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"
我创建了一个示例项目来重现该问题,它包含 -
您可以在这里下载测试项目: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,没有测试版(MvvmCross 除外)。
我做错了什么?
我非常喜欢 MvvmCross,并且我开始将现有的 Windows 8.1/Windows Phone 8.1 解决方案移植到 Uwp - 只是对将最新的 MvvmCross 位与 Uwp 结合使用进行一些探索性研究。
感谢您的帮助!@ehuna
最佳答案
您使用的 View 不正确,您得到的 AccessViolation 毫无疑问是毫无帮助的。问题似乎是运行时找不到您指定的 View 并因模糊异常而崩溃。
TestView.xaml 看起来像
<views:MvxWindowsPage
x:Class="Test.Uwp.Views.View1"
...
但应该是
<views:MvxWindowsPage
x:Class="Test.Uwp.Views.TestView"
分别你的 TestView.xaml.cs 看起来像
public sealed partial class TestView : MvxWindowsPage<TestViewModel>
{
public TestView()
{
}
}
但它应该是这样的
public sealed partial class TestView : MvxWindowsPage
{
public TestView()
{
this.InitializeComponent();
}
}
然后一切都会正常工作。我获得的有趣见解:MvxWindowsPage<TestViewModel>
似乎根本不起作用。
关于c# - 启动 MvvmCross Uwp 应用程序时出现异常 : "System.AccessViolationException: Attempted to read or write protected memory",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33064499/
我有一个正在运行的服务,它连接到几个客户端。它已经启动并运行了数周,并且该函数每分钟被调用多次,我在不同的函数中遇到了一些问题,但是这个异常让它一直崩溃。我以前从未见过这个问题。谁能让这发生? 堆栈:
我们正在使用 Kinect 流式传输用户的可自定义视频,您可以在不停止流的情况下选择流类型(颜色、深度,都可以选择显示跟踪的骨架)。 如果我们更改流类型,我们的程序运行良好,但在启用框架的几帧(并且仅
我正在尝试使用 Steve Sanderson's blog post为了在我的 ASP MVC 3 View 中编辑可变长度列表。该项目构建良好,但是每当呈现局部 View 时,程序就会在 usin
我在 C# 中使用了很长时间,但我从未遇到过这种错误。首先,您是否看到关于这个单个代码块的任何错误(可能是错误的)(当然除了它的逻辑,我知道它总是返回 0)? public static int Ge
我在 .net 应用程序中使用 COM 对象 (MODI)。我调用的方法抛出 System.AccessViolationException,它被 Visual Studio 拦截。奇怪的是,我将我的
我正在编写这个库,它通过媒体基础框架在 C++/CLI 中实现一些基本的音频播放器功能,这些功能将由托管代码使用。我可以播放音频、停止、暂停等。对于不熟悉媒体基础的任何人,媒体 session 都会发
我们遇到的问题是有时 AccessViolationException会出现一个简单的组框,它带有白色背景,上面有一个红十字。我们无法可靠地重现此错误,它只是不时发生。 我们没有做任何特别的事情,我们
我正在处理一个目录项目,当程序没有被使用或空闲 3 分钟时,一个充当 的表单待机屏幕播放视频将显示(我使用 AxWindowsMediaPlayer )。通过单击表单中的任意位置,待机屏幕将关闭并返回
我有一个在 VS2015 和 .Net 4.5.2 中运行的大型 vb.net x86 项目 当它在没有优化的情况下编译并在调试中运行时,它可以正常工作。但是,如果我在 Release模式下编译并运行
我们使用自动崩溃报告工具(即 http://crashrpt.sourceforge.net)来生成崩溃报告。 因此,如果一段非托管代码通过访问 NULL 失败例如,应用程序崩溃,崩溃报告工具激活,我
我有一个Windows服务,它以未处理的方式崩溃,但异常System.AccessViolationException。尝试加载用户个人资料时(在模拟过程中),我确实发生过1000种情况之一。我对找到
我正在使用 Excel 2010 和 VSTO 4 在 .NET 4.0 (C#) 中开发 Excel 加载项。在我的 Excel 访问器类中,我有一个属性“CurrentWorkbook”,它返回
大约一周前,每当我在某个文本框中键入内容时,我正在开发的一个程序就会开始崩溃,并出现 AccessViolationException。我已将其简化为这个测试用例,但我没有主意: Imports Sy
当我从 Visual C++ 以 Release模式运行我的应用程序时,出现以下异常。 Unhandled Exception: System.AccessViolationException: At
我在我的程序中使用了一个外部 C 库,用 C++/CLI 和 .NET 框架 4 编码。有时库崩溃,我收到消息: Unhandled Exception: System.AccessViolation
我已经为 SAPI5 Eliska22k 安装了捷克语音。它在 Windows 7 上工作正常。现在我有 Windows 8,在调用 Speak 方法时它给了我 Attempted to read o
我正在使用 wkHTMLtoXSharp 包装器在 Windows 2008 R2 上调用 wkHTMLtoPDF 库。除了一个异常(exception),一切都很好。我正在从 C# Windows
我正在尝试使用来自 C# 的非托管 API,并用头撞墙。 (就 PInvoke 而言,我是一个初学者。) 头文件的相关部分如下所示: #define CTAPICALL __stdcall
我正在尝试与实现多个函数的 Dll 进行交互,其中一个采用以空字符结尾的字符串和一个 int,并返回以空字符结尾的字符串。我试图与这样的方法交互: [DllImport(dll_loc)] [retu
我有一个 asp.net (3.5) 网络应用程序。在一个页面中,我使用了一个非托管 C 库(一个模拟器),它根据一些输入生成一组结果。 当我在 web.config( Release模式)中设置 d
我是一名优秀的程序员,十分优秀!