访问冲突异常 C# [英] Access violation exception c#

查看:25
本文介绍了访问冲突异常 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我抛出异常的代码,它今天刚开始随机启动这里是照片:

This is my code that throws an exception, it just randomly started today here is the photo :

这里是整个页面代码和错误异常:

Here is the whole page code and the error exception :

 public frmWFDocumentDetail()
    {
        InitializeComponent();

        NavigationInTransition navigateInTransition = new NavigationInTransition();
        navigateInTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn };
        navigateInTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn };

        NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
        navigateOutTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut };
        navigateOutTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut };
        TransitionService.SetNavigationInTransition(this, navigateInTransition);
        TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

        DataContext = App.ViewModel_WFDocumentDetailItems;
    }

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        //**this is how you pass parameters through to a new page**//
        string processID = "-1";
        string processName = "";
        NavigationContext.QueryString.TryGetValue("processID", out processID);
        NavigationContext.QueryString.TryGetValue("processName", out processName);

        App.ViewModel_WFDocumentHeaderItems.LoadData("johnny", processID);

        App.ViewModel_WFDocumentDetailItems.LoadData("johnny");

    }

和访问冲突:

System.AccessViolationException:试图读取或写入受保护的内存.这通常表明其他内存已损坏.

我已经阅读了它,有人说它是 nvidia 网络管理器,有人说我必须设置一些设置,例如 Suppress JIT optimization ,如果值没有改变,则忽略 gpu 内存......但没有任何效果?任何人都可以请给我正确的方向吗?

I have read up on it, some people say it is nvidia network manager, and some people say I must set some setting like Suppress JIT optimization , and ignore gpu memory if value isn't changed... but nothing works? Can anyone please please send me in the right direction?

根据要求,完整的堆栈

推荐答案

我使用了 taylorjohnl 给我的设置调试 -> 选项和设置 -> 调试 -> 常规 -> 启用仅我的代码",然后错误去了正确的 xaml 是一个语法错误,boom 修复了它并且应用程序再次运行:) 所以违规错误对我来说基本上是一个参考错误,希望这也可以帮助其他人,也可以使用 Silverlight 中的表达式混合进行调试用户界面中的 xaml

i used the setting taylorjohnl gave me "Debug -> Options and Settings -> Debugging -> General -> Enable Just My Code",and then the error went right to the piece of xaml that was a syntax error, and boom fixed it and app works again :) so violation error for me was basically a reference error, hope this can help other people as well, also use expression blend in silverlight to debug xaml in the UI

这篇关于访问冲突异常 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆